Closed bdaniels134 closed 2 months ago
OK, did you check the directories you are giving in your -L arguments to see if the .a or .so files are present?
Also I don't think it's w3, it's w3emc_4.
But look in the directories to see what files you have.
Thanks Ed!
Yes, if I look into each libraries' dir there are .a files. For example in: /spack/linux-rhel8-skylake_avx512/gcc-8.5.0/w3emc-2.12.0-qqdlddn5jgzygk7noqxqez6oc3ck3h5b/lib64/libw3emc_4.a
So, next is setting the linking and naming of the libraries correctly. Should I be able to access the libraries found under /gcc-8.5.0 by naming them like -lw3emc_4 or should I explicitly use the full path for each libraries .a file? I can test this so no worries if you don't know.
Thanks, Bob
Set the directory with the -L argument, then link to the library by putting a -l in front of the name, and leaving off the .a.
Like this:
gcc -L /install/dir/lib my_code.c -lw3emc_4
Thanks!
OK, I'll close this issue, let me know if you need any more help.
Describe the bug This could be an installation or bad referencing issue but bug seemed to be the right choice. Appreciate your help or suggestions. I recently had NCEPLIBS installed for us on our new linux RHEL 8 compute farm vms for NCEP/OPC. The libraries are not being recognized by my makefile that builds fortran code using the gfortran compiler. I'm not sure if I'm using the correct library names or if there was a problem with the installation. To Reproduce I'm trying to compile FORTRAN code to make grib2 files that uses the libraries bacio, w3 and g2_4 When running the makefile I get the following:
make /usr/bin/gfortran -o nc2grib_ncom ./nc2grib2_ncom.o -L/opt/common_apps/nceplibs/spack/opt/spack/linux-rhel8-skylake_avx512/gcc-8.5.0/ -lg2_4 -lw3 -lbacio -L/usr/lib64 -ljasper -lpng -lz /usr/bin/ld: cannot find -lg2_4 /usr/bin/ld: cannot find -lw3 /usr/bin/ld: cannot find -lbacio
Expected behavior The location of the libraries is linked in the makefile so I'm not sure why they are not found. Tried different variations of the library names as they are listed in the installation dirs but this gave same error.
Build Information How did you build or access NCEPLIBS? Installed recently by NCO Helpdesk who have root privledges. System On what system are you running the code? Linux RHEL8 Additional context The code was written several years back and hoping to recompile it for a change in our systems. Appreciate any help or suggestions.