ecmwf / eccodes-python

Python interface to the ecCodes GRIB/BUFR decoder/encoder
Apache License 2.0
115 stars 33 forks source link

Building eccodes #35

Closed akashpulimel closed 1 year ago

akashpulimel commented 4 years ago

Hello all,

I'm trying to install eccodes on my windows 10 system by following the instructions provided in the GitHub page(https://github.com/ecmwf/eccodes). While running the -DCMAKE_INSTALL_PREFIX line of the code (in command prompt), it starts to build but soon exits with the following error:

"CMake Error at cmake/ecbuild_log.cmake:196 (message): CRITICAL - Failed to replace windows symlinks. output=[] error=[/bin/bash: E:/Akash/eccodes-2.18.0-Source/cmake/ecbuild_windows_replace_symlinks.sh: No such file or directory

] Call Stack (most recent call first): cmake/ecbuild_check_os.cmake:450 (ecbuild_critical) cmake/ecbuild_system.cmake:265 (include) CMakeLists.txt:25 (include)

-- Configuring incomplete, errors occurred! See also "E:/Akash/build/CMakeFiles/CMakeOutput.log".

I'm using cmake-3.18.3-win64-x64, eccodes-2.18.0-Source (downloaded from https://confluence.ecmwf.int/display/ECC/Releases and extracted as instructed), I have installed Ubuntu from windows store and I'm building in a clean directory. 'CMakeOutput.log' and 'ecbuild.log' files are also attached here for your reference. CMakeOutput.log . ecbuild.log

If anybody has any solutions/suggestions on this, please help.

Thanks, Akash

shahramn commented 1 year ago

Windows is not fully supported

MRPHarris commented 1 year ago

Hi @akashpulimel, did you ever find a solution to this issue? I am trying to compile on windows and have run into the exact same error.

-- Quick edit --

I have solved this issue for my compilation attempt on Windows. Bash was unable to find the symlink replacement sh file, due to the handling of directories passed to bash in the execute_process function within ecbuild_check_os.cmake. In bash, if I changed the working directory to the project source directory, then passed bash the shortened path "./cmake/ecbuild_windows_replace_symlinks.sh", it was able to find and run the script.

To implement this fix, I changed these lines in ecbuild_check_os.cmake:

execute_process( COMMAND ${BASH_EXE} -c "${ECBUILD_MACROS_DIR}/ecbuild_windows_replace_symlinks.sh" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE CMD_RESULT OUTPUT_VARIABLE CMD_OUTPUT ERROR_VARIABLE CMD_ERROR )

To the following:

set (bash_cmd "bash") set (bash_arg -c "./cmake/ecbuild_windows_replace_symlinks.sh") execute_process( COMMAND ${bash_cmd} ${bash_arg} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE CMD_RESULT OUTPUT_VARIABLE CMD_OUTPUT ERROR_VARIABLE CMD_ERROR )