[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #QWR-165524]: building netcdf-c failed with error "ld: unknown option: --no-undefined"



Hello,

This failure should not be a problem; it is one of the test programs used by 
`cmake` to determine the capabilities of the system, and the output you provide 
looks as one would expect if the linker does not support the `--no-undefined` 
flag. 

Does cmake itself indicate an error when configuring netCDF, or does make 
generate an error when trying to compile?  If so, can you provide the errors 
you see on the command line?  

Thank you,

-Ward

> Hello,
> I was building netcdf-c with a OS X machine,
> I use gcc6.1.0, I got the error indicated above. The more length
> description of the error is as following. I tried commented out the
> --no-undefined option, however I ended with no luck. Would you suggest any
> further places to look into the for the actual problem? Many thanks in
> advance.
> 
> CMakeError.log
> 
> Performing C SOURCE FILE Test LIBTOOL_HAS_NO_UNDEFINED failed with the
> following output:
> 
> Change Dir:
> /Users/jinyuntang/work/github_repo/sbetr/build/Darwin-x86_64-static-double-cc-Debug/3rd-party/netcdf-c/CMakeFiles/CMakeTmp
> 
> 
> Run Build Command:"/opt/local/bin/gmake" "cmTC_8754e/fast"
> 
> gmake[1]: Entering directory
> '/Users/jinyuntang/work/github_repo/sbetr/build/Darwin-x86_64-static-double-cc-Debug/3rd-party/netcdf-c/CMakeFiles/CMakeTmp'
> 
> /opt/local/bin/gmake -f CMakeFiles/cmTC_8754e.dir/build.make
> CMakeFiles/cmTC_8754e.dir/build
> 
> gmake[2]: Entering directory
> '/Users/jinyuntang/work/github_repo/sbetr/build/Darwin-x86_64-static-double-cc-Debug/3rd-party/netcdf-c/CMakeFiles/CMakeTmp'
> 
> Building C object CMakeFiles/cmTC_8754e.dir/src.c.o
> 
> /usr/bin/cc    -DLIBTOOL_HAS_NO_UNDEFINED -Wl,--no-undefined   -o
> CMakeFiles/cmTC_8754e.dir/src.c.o   -c
> /Users/jinyuntang/work/github_repo/sbetr/build/Darwin-x86_64-static-double-cc-Debug/3rd-party/netcdf-c/CMakeFiles/CMakeTmp/src.c
> 
> clang: warning: -Wl,--no-undefined: 'linker' input unused
> 
> Linking C executable cmTC_8754e
> 
> /opt/local/bin/cmake -E cmake_link_script
> CMakeFiles/cmTC_8754e.dir/link.txt --verbose=1
> 
> */usr/bin/cc   -DLIBTOOL_HAS_NO_UNDEFINED -Wl,--no-undefined
> -Wl,-search_paths_first -Wl,-headerpad_max_install_names
> CMakeFiles/cmTC_8754e.dir/src.c.o  -o cmTC_8754e  *
> 
> *ld: unknown option: --no-undefined*
> 
> *clang: error: linker command failed with exit code 1 (use -v to see
> invocation)*
> 
> *CMakeFiles/cmTC_8754e.dir/build.make:97: recipe for target 'cmTC_8754e'
> failed*
> 
> *gmake[2]: *** [cmTC_8754e] Error 1*
> 
> *gmake[2]: Leaving directory
> '/Users/jinyuntang/work/github_repo/sbetr/build/Darwin-x86_64-static-double-cc-Debug/3rd-party/netcdf-c/CMakeFiles/CMakeTmp'*
> 
> *Makefile:126: recipe for target 'cmTC_8754e/fast' failed*
> 
> *gmake[1]: *** [cmTC_8754e/fast] Error 2*
> 
> *gmake[1]: Leaving directory
> '/Users/jinyuntang/work/github_repo/sbetr/build/Darwin-x86_64-static-double-cc-Debug/3rd-party/netcdf-c/CMakeFiles/CMakeTmp'*
> 
> 
> Source file was:
> 
> int main() {return 0;}
> 

> 


Ticket Details
===================
Ticket ID: QWR-165524
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.