esm-tools / esm_tools

Simple Infrastructure for Earth System Simulations
https://esm-tools.github.io/
GNU General Public License v2.0
25 stars 12 forks source link

installing echam #1241

Open yoluo001 opened 1 week ago

yoluo001 commented 1 week ago

When installing echam, enter the following statement "esm_master install-echam-6.3.05p2" and an error occurs after running, as shown in the following screenshot.

Screenshot 2024-10-25 at 12 15 06

pgierz commented 1 week ago

This is a glibc error, and affects all of albedo, might be linked to the container image currently on the login nodes.

pgierz commented 2 days ago

Hi @yoluo001,

I have a provisional fix which should allow you to compile the model. I'm not sure why this hasn't popped up before, maybe you are the first person to run ECHAM-6.3.05p2 standalone on Albedo.

In your echam-6.3.05p2 source code folder, you need to modify the following file to allow the linker to find librt.so:

diff --git a/cdi/src/CMakeLists.txt b/cdi/src/CMakeLists.txt
index 2183e78..c8b80ae 100644
--- a/cdi/src/CMakeLists.txt
+++ b/cdi/src/CMakeLists.txt
@@ -23,6 +23,7 @@ target_compile_definitions(${PROJECT_NAME} PUBLIC VERSION="1.7.0" gFortran HAVE_
 target_link_libraries(${PROJECT_NAME}
    PRIVATE yaxt
    INTERFACE ${NETCDF_C_LIBRARIES} ${HDF5_C_LIBRARIES}
+   rt
 )
 if(${CMAKE_C_COMPILER_ID} STREQUAL Intel)
        # enable c99 for intel (icc defaults to c89) (gcc already defaults to a c dialect of this century)

With that addition (on little line) it compiles for me. Let me know how it works for you.

Cheers, Paul

yoluo001 commented 2 days ago

Dear Paul,

I tried to modify it as what you said, but it seems to fail. If it is convenient for you, could you share the file you successfully ran with me? Thanks a lot.

All the best, Yongyue

  1. Oct 2024 09:57,Paul Gierz @.***> 写道:

Hi @yoluo001https://github.com/yoluo001,

I have a provisional fix which should allow you to compile the model. I'm not sure why this hasn't popped up before, maybe you are the first person to run ECHAM-6.3.05p2 standalone on Albedo.

In your echam-6.3.05p2 source code folder, you need to modify the following file to allow the linker to find librt.so:

diff --git a/cdi/src/CMakeLists.txt b/cdi/src/CMakeLists.txt index 2183e78..c8b80ae 100644 --- a/cdi/src/CMakeLists.txt +++ b/cdi/src/CMakeLists.txt @@ -23,6 +23,7 @@ target_compile_definitions(${PROJECTNAME} PUBLIC VERSION="1.7.0" gFortran HAVE target_link_libraries(${PROJECT_NAME} PRIVATE yaxt INTERFACE ${NETCDF_C_LIBRARIES} ${HDF5_C_LIBRARIES}

With that addition (on little line) it compiles for me. Let me know how it works for you.

Cheers, Paul

— Reply to this email directly, view it on GitHubhttps://github.com/esm-tools/esm_tools/issues/1241#issuecomment-2446232872, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BMNHYJH7NGXWDOJKWKB24T3Z6CNPTAVCNFSM6AAAAABQTCVMS6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBWGIZTEOBXGI. You are receiving this because you were mentioned.Message ID: @.***>