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

Build script can not find '-laec' when libaec is installed in non-default directory #267

Closed
DusanJovic-NOAA opened this issue Oct 11, 2024 · 0 comments · Fixed by #275
Closed
Assignees
Labels
build Relates to the build system

Comments

@DusanJovic-NOAA
Copy link

The compilation fails with this error:

[ 96%] Built target obj_lib
[ 97%] Linking C executable wgrib2
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: cannot find -laec: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [wgrib2/CMakeFiles/wgrib2_exe.dir/build.make:678: wgrib2/wgrib2] Error 1
make[1]: *** [CMakeFiles/Makefile2:955: wgrib2/CMakeFiles/wgrib2_exe.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I have libaec (and all other 3rdparty libraries) installed in a local directory, and I specified that location with -DCMAKE_PREFIX_PATH.

The location of aec library in wgrib2/CMakeLists.txt should be specified using LIBAEC_LIBRARIES variable instead of aec string.

diff --git a/wgrib2/CMakeLists.txt b/wgrib2/CMakeLists.txt
index 4a8033d..18d78b4 100644
--- a/wgrib2/CMakeLists.txt
+++ b/wgrib2/CMakeLists.txt
@@ -125,7 +125,7 @@ target_link_libraries(obj_lib PUBLIC gctpc -lm)
 target_link_libraries(wgrib2_exe PRIVATE gctpc)
 
 if(USE_AEC)
-  target_link_libraries(wgrib2_exe PRIVATE aec)
+  target_link_libraries(wgrib2_exe PRIVATE ${LIBAEC_LIBRARIES})
 endif()
 
 if(USE_OPENJPEG)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Relates to the build system
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants