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

Compilation error with VIC5.1.0: "collect2: error: ld returned 1 exit status" #940

Open
bijoychandraAU opened this issue Nov 21, 2023 · 3 comments

Comments

@bijoychandraAU
Copy link

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

@bijoychandraAU bijoychandraAU changed the title Error with VIC5.1.0: "collect2: error: ld returned 1 exit status" Compilation error with VIC5.1.0: "collect2: error: ld returned 1 exit status" Nov 22, 2023
@dwoodson-usbr
Copy link

Are you trying to compile the classic or image driver?

@bijoychandraAU
Copy link
Author

bijoychandraAU commented Dec 5, 2023

@dwoodson-usbr I am using the classic driver.

@dwoodson-usbr
Copy link

@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$"

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

No branches or pull requests

2 participants