Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starting to rebuild cmake build system #78

Closed
wants to merge 21 commits into from
Closed

Conversation

edwardhartnett
Copy link
Contributor

Part of #60.

@edwardhartnett edwardhartnett marked this pull request as ready for review January 3, 2024 15:35
@edwardhartnett edwardhartnett marked this pull request as draft January 3, 2024 15:35
@edwardhartnett edwardhartnett marked this pull request as ready for review January 4, 2024 12:33
@edwardhartnett edwardhartnett marked this pull request as draft January 4, 2024 12:34
@edwardhartnett
Copy link
Contributor Author

@webisu it's failing like this, any idea why?

/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/Proj4.c:21:10: fatal error: proj_api.h: No such file or directory
   21 | #include "proj_api.h"
      |          ^~~~~~~~~~~~
compilation terminated.

@webisu
Copy link
Collaborator

webisu commented Jan 8, 2024 via email

@edwardhartnett
Copy link
Contributor Author

Any reason not to make a permanent copy of proj_api.h?

@edwardhartnett
Copy link
Contributor Author

@webisu there is no proj_api.h anywhere in the repo. Where should I copy it from?

@webisu
Copy link
Collaborator

webisu commented Jan 8, 2024 via email

@edwardhartnett
Copy link
Contributor Author

edwardhartnett commented Jan 8, 2024

@webisu so I unpacked the proj4 tarball and found the proj_api.h file.

But there is no grib2/include directory anywhere in the repo:

ed@Pooh-Bah:~/wgrib2$ find . -name include
./wgrib2/gctpc/source/include
./wgrib2/gctpc/test/source/include

@webisu
Copy link
Collaborator

webisu commented Jan 8, 2024 via email

@webisu
Copy link
Collaborator

webisu commented Jan 8, 2024 via email

@edwardhartnett
Copy link
Contributor Author

There is no include directory in the repo.

Is it create by the makefile or some other way?

What should be in it, other than proj_api.h?

@webisu
Copy link
Collaborator

webisu commented Jan 8, 2024 via email

@edwardhartnett
Copy link
Contributor Author

Well in normal installs, there are usually two include directories. One is part of the source tree, and one is created on install in the install location. The install include will only have public include files. That is, files you want your users to include.

The repo include directory will have these files, and also any internal .h files.

For example, netcdf-c has an include directory https://github.com/Unidata/netcdf-c/tree/main/include, and when you install netcdf-c, it creates an include directory as part of the install, and copies some of the .h files there.

But the install include directory cannot be used in the build. It's created after the build it complete. So I have moved a copy of proj_api.h to the wgrib2 directory.

Currently you are using the wgrib2 directory as your include directory:

ed@Pooh-Bah:~/wgrib2$ find . -name '*.h'
./proj-4.8.0/src/pj_list.h
./proj-4.8.0/src/emess.h
./proj-4.8.0/src/org_proj4_Projections.h
./proj-4.8.0/src/proj_api.h
./proj-4.8.0/src/geocent.h
./proj-4.8.0/src/projects.h
./proj-4.8.0/src/geodesic.h
./c_api/c_wgrib2api.h
./proj.h
./iplib.v3.0.0/iplib_d.h
./iplib.v3.0.0/iplib_8.h
./iplib.v3.0.0/iplib_4.h
./iplib.v3.0.0/ipolate.h
./ip2lib_d/iplib_d.h
./ip2lib_d/iplib_8.h
./ip2lib_d/config.h
./ip2lib_d/iplib_4.h
./g2clib-1.4.0/drstemplates.h
./g2clib-1.4.0/pdstemplates.h
./g2clib-1.4.0/gridtemplates.h
./g2clib-1.4.0/grib2.h
./aux_progs/grb2.h
./wgrib2/proj4_wgrib2.h
./wgrib2/gctpc/source/include/proj.h
./wgrib2/gctpc/source/include/cproj.h
./wgrib2/gctpc/test/source/include/proj.h
./wgrib2/gctpc/test/source/include/cproj.h
./wgrib2/fnlist.h
./wgrib2/wgrib2.h
./wgrib2/config.h
./wgrib2/wgrib2nc.h
./wgrib2/proj_api.h
./wgrib2/wgrib2_api.h
./wgrib2/grid_id.h
./wgrib2/grb2.h
./wgrib2/ipolates.h
./wgrib2/CodeTable4_4.h


By the end of our work on wgrib2, almost all of these will be removed

@edwardhartnett
Copy link
Contributor Author

OK, lots of progress but now it is failing with this. @webisu do you know what is happening?

/usr/bin/ld: CMakeFiles/wgrib2_exe.dir/wgrib2.c.o: in function `main':
/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:223: undefined reference to `init_check_v1_v2'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:247: undefined reference to `check_v1_v2'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:257: undefined reference to `is_v1_v2'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:507: undefined reference to `check_pdt_size'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:523: undefined reference to `f_match_inv'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:540: undefined reference to `run_flag'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:613: undefined reference to `fix_undef'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:803: undefined reference to `run_flag'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:804: undefined reference to `run_flag'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:810: undefined reference to `v1_if'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:813: undefined reference to `v1_else'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:816: undefined reference to `v1_endif'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:819: undefined reference to `v1_elseif'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/wgrib2.c:822: undefined reference to `run_flag'
/usr/bin/ld: CMakeFiles/obj_lib.dir/ExtName.c.o: in function `f_misc':
/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/ExtName.c:61: undefined reference to `f_cluster'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/ExtName.c:200: undefined reference to `f_type_reftime'
/usr/bin/ld: CMakeFiles/obj_lib.dir/Ftime2.c.o: in function `print_ftime2':
/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/Ftime2.c:381: undefined reference to `ftime_mode'
/usr/bin/ld: CMakeFiles/obj_lib.dir/Hybrid.c.o: in function `f_hybrid':
/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/Hybrid.c:18: undefined reference to `pdt_len'
/usr/bin/ld: CMakeFiles/obj_lib.dir/If_rec.c.o: in function `f_if_rec':
/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/If_rec.c:45: undefined reference to `run_flag'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/If_rec.c:46: undefined reference to `run_flag'
/usr/bin/ld: CMakeFiles/obj_lib.dir/Inv_no.c.o: in function `f_if_n':
/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/Inv_no.c:85: undefined reference to `run_flag'
/usr/bin/ld: /home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/Inv_no.c:86: undefined reference to `run_flag'
/usr/bin/ld: CMakeFiles/obj_lib.dir/Macro.c.o: in function `f_inv_f77':
/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/Macro.c:199: undefined reference to `f_match_inv'
/usr/bin/ld: CMakeFiles/obj_lib.dir/Match.c.o: in function `f_if':
/home/runner/work/wgrib2/wgrib2/wgrib2/wgrib2/Match.c:179: undefined reference to `run_flag'

@edwardhartnett
Copy link
Contributor Author

@webisu any idea why the build is not working? See message above for output...

@webisu
Copy link
Collaborator

webisu commented Jan 10, 2024 via email

@edwardhartnett
Copy link
Contributor Author

Take a look here to see all the output: https://github.com/NOAA-EMC/wgrib2/actions/runs/7464889377/job/20312855802?pr=78

@edwardhartnett edwardhartnett deleted the ejh_cmake branch July 17, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants