Compilation error with VIC5.1.0: "collect2: error: ld returned 1 exit status"
Opened this issue · 3 comments
Compilation of VIC 5.1.0 in cluster/ubuntu having GCC 12.2.0 has an error "collect2: error: ld returned 1 exit status".
However, the same system compiles successfully with earlier versions such as VIC4.2.d.
Please let me know how I can fix it.
Thank you
Are you trying to compile the classic or image driver?
@dwoodson-usbr I am using the classic driver.
@bijoychandraAU Did you make any changes in the makefile? Are there any other error messages to indicate which line in the makefile failed? You may need to point explicitly to where gcc is installed. Also, if you are running a conda base environment, sometimes that can interfere with non-conda dependencies, so deactivate it.
If you haven't already, try editing the makefile for your compiler:
# Set CC = your compiler here
ifndef CC
CC=gcc
endif
To something like:
# Set CC = your compiler here
ifndef CC
CC=/usr/bin/gcc
endif
You can find where gcc is installed on your system with:
locate -br "^gcc$"