CNES / MAJA

Level-2A processor used for atmospheric correction and cloud-detection. The active repository is the one below, this one is kept to leave access to the older issues.
https://gitlab.orfeo-toolbox.org/maja/maja
Apache License 2.0
137 stars 25 forks source link

CMake error for EXPAT when compiling MAJA #93

Closed aafaf-arharas closed 2 years ago

aafaf-arharas commented 2 years ago

Hi everyone,

I tried to compile MAJA from source several times, I installed all the dependencies however always got the following error :

root@d4c5801f4c33:~/software/MAJA/build# make [ 3%] Built target SQLITE [ 6%] Built target PATCHELF [ 9%] Built target ZLIB [ 9%] Performing download step (download, verify and extract) for 'EXPAT' CMake Error at stamp/EXPAT-download-Release.cmake:49 (message): Command failed: 1

'/usr/bin/cmake' '-Dmake=' '-Dconfig=' '-P' '/root/software/MAJA/build/EXPAT/stamp/EXPAT-download-Release-impl.cmake'

See also

/root/software/MAJA/build/EXPAT/stamp/EXPAT-download-*.log

make[2]: [CMakeFiles/EXPAT.dir/build.make:91: EXPAT/stamp/EXPAT-download] Error 1 make[1]: [CMakeFiles/Makefile2:662: CMakeFiles/EXPAT.dir/all] Error 2 make: *** [Makefile:95: all] Error 2

Anyone has an idea about how to fix this error? Many thanks, Aafaf

jerome-colin commented 2 years ago

Hi, Could you please paste here the content of the files '/root/software/MAJA/build/EXPAT/stamp/EXPAT-download-err.log' and '/root/software/MAJA/build/EXPAT/stamp/EXPAT-download-out.log' ? Thanks, Jerome

aafaf-arharas commented 2 years ago

Hi, Here is the content of the file '/root/software/MAJA/build/EXPAT/stamp/EXPAT-download-err.log' :

root@d4c5801f4c33:~/software/MAJA/build/EXPAT/stamp# cat EXPAT-download-err.log CMake Error at stamp/download-EXPAT.cmake:159 (message): Each download failed!

error: downloading 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' failed
     status_code: 22
     status_string: "HTTP response code said error"
     log:
     --- LOG BEGIN ---
       Trying 204.68.111.105:80...

TCP_NODELAY set

Connected to downloads.sourceforge.net (204.68.111.105) port 80 (#0)

GET /project/expat/expat/2.1.0/expat-2.1.0.tar.gz HTTP/1.1

Host: downloads.sourceforge.net

User-Agent: curl/7.66.0

Accept: /

Mark bundle as not supporting multiuse

The requested URL returned error: 404 Not Found

Closing connection 0

     --- LOG END ---
     error: downloading 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' failed
     status_code: 22
     status_string: "HTTP response code said error"
     log:
     --- LOG BEGIN ---
       Trying 204.68.111.105:80...

TCP_NODELAY set

Connected to downloads.sourceforge.net (204.68.111.105) port 80 (#0)

GET /project/expat/expat/2.1.0/expat-2.1.0.tar.gz HTTP/1.1

Host: downloads.sourceforge.net

User-Agent: curl/7.66.0

Accept: /

Mark bundle as not supporting multiuse

The requested URL returned error: 404 Not Found

Closing connection 0

     --- LOG END ---
     error: downloading 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' failed
     status_code: 22
     status_string: "HTTP response code said error"
     log:
     --- LOG BEGIN ---
       Trying 204.68.111.105:80...

TCP_NODELAY set

Connected to downloads.sourceforge.net (204.68.111.105) port 80 (#0)

GET /project/expat/expat/2.1.0/expat-2.1.0.tar.gz HTTP/1.1

Host: downloads.sourceforge.net

User-Agent: curl/7.66.0

Accept: /

Mark bundle as not supporting multiuse

The requested URL returned error: 404 Not Found

Closing connection 0

     --- LOG END ---
     error: downloading 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' failed
     status_code: 22
     status_string: "HTTP response code said error"
     log:
     --- LOG BEGIN ---
       Trying 204.68.111.105:80...

TCP_NODELAY set

Connected to downloads.sourceforge.net (204.68.111.105) port 80 (#0)

GET /project/expat/expat/2.1.0/expat-2.1.0.tar.gz HTTP/1.1

Host: downloads.sourceforge.net

User-Agent: curl/7.66.0

Accept: /

Mark bundle as not supporting multiuse

The requested URL returned error: 404 Not Found

Closing connection 0

     --- LOG END ---
     error: downloading 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' failed
     status_code: 22
     status_string: "HTTP response code said error"
     log:
     --- LOG BEGIN ---
       Trying 204.68.111.105:80...

TCP_NODELAY set

Connected to downloads.sourceforge.net (204.68.111.105) port 80 (#0)

GET /project/expat/expat/2.1.0/expat-2.1.0.tar.gz HTTP/1.1

Host: downloads.sourceforge.net

User-Agent: curl/7.66.0

Accept: /

Mark bundle as not supporting multiuse

The requested URL returned error: 404 Not Found

Closing connection 0

     --- LOG END ---
     error: downloading 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' failed
     status_code: 22
     status_string: "HTTP response code said error"
     log:
     --- LOG BEGIN ---
       Trying 204.68.111.105:80...

TCP_NODELAY set

Connected to downloads.sourceforge.net (204.68.111.105) port 80 (#0)

GET /project/expat/expat/2.1.0/expat-2.1.0.tar.gz HTTP/1.1

Host: downloads.sourceforge.net

User-Agent: curl/7.66.0

Accept: /

Mark bundle as not supporting multiuse

The requested URL returned error: 404 Not Found

Closing connection 0

     --- LOG END ---

CMake Error at stamp/EXPAT-download-Release-impl.cmake:9 (message): Command failed (1):

'/usr/bin/cmake' '-P' '/root/software/MAJA/build/EXPAT/stamp/download-EXPAT.cmake'

root@d4c5801f4c33:~/software/MAJA/build/EXPAT/stamp#

aafaf-arharas commented 2 years ago

And that's the content of the file EXPAT-download-out.log :

root@d4c5801f4c33:~/software/MAJA/build/EXPAT/stamp# cat EXPAT-download-out.log

-- verifying file... file='/root/software/MAJA/SuperBuild-archives/expat-2.1.0.tar.gz' -- MD5 hash of /root/software/MAJA/SuperBuild-archives/expat-2.1.0.tar.gz does not match expected value expected: 'dd7dab7a5fea97d2a6a43f511449b7cd' actual: 'd41d8cd98f00b204e9800998ecf8427e' -- File already exists but hash mismatch. Removing... -- Downloading... dst='/root/software/MAJA/SuperBuild-archives/expat-2.1.0.tar.gz' timeout='none' -- Using src='http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' -- Retrying... -- Using src='http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' -- Retry after 5 seconds (attempt #2) ... -- Using src='http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' -- Retry after 5 seconds (attempt #3) ... -- Using src='http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' -- Retry after 15 seconds (attempt #4) ... -- Using src='http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' -- Retry after 60 seconds (attempt #5) ... -- Using src='http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' root@d4c5801f4c33:~/software/MAJA/build/EXPAT/stamp#

Thanks, Aafaf

jerome-colin commented 2 years ago

Ok, the link to the package is broken. Indeed expat-2.1.0 is deprecated, though you can still get it from the following link: https://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0-RENAMED-VULNERABLE-PLEASE-USE-2.3.0-INSTEAD.tar.gz/download A simple workaround is to download it to a given directory you point to with the 'DOWNLOAD_DIR' you'll set when invoking ccmake. If it strictly looks for 'expat-2.1.0.tar.gz', you may just rename/symlink the package you downloaded. Another option could be to get the devel package of expat right from your distribution repo, but I've never tested this.

Hope this helps, let me know, Jerome

aafaf-arharas commented 2 years ago

Hi Jerome, Hope i don't bother you. I'm not familiar with cmake files, can you please specify which file I need to edit and what is the command exactly. DOWNLOAD_DIR = /src ? Thanks, Aafaf

jerome-colin commented 2 years ago

Hi, you don't bother, I'm glad to help :-) No need to edit the makefile itself. When you call 'cmake', just add '-DDOWNLOAD_DIR=XXXX' as an argument. Alternatively, if you use the command 'ccmake ../Superbuild' from the 'build' directory, you'll see an entry called 'DOWNLOAD_DIR'. Jerome

aafaf-arharas commented 2 years ago

Hi, It worked, it fixed the EXPAT problem. But now, I get another error : `running build running build_py creating build creating build/lib.linux-x86_64-3.7 copying gdal.py -> build/lib.linux-x86_64-3.7 copying ogr.py -> build/lib.linux-x86_64-3.7 copying osr.py -> build/lib.linux-x86_64-3.7 copying gdalconst.py -> build/lib.linux-x86_64-3.7 copying gdalnumeric.py -> build/lib.linux-x86_64-3.7 creating build/lib.linux-x86_64-3.7/osgeo copying osgeo/gnm.py -> build/lib.linux-x86_64-3.7/osgeo copying osgeo/gdal.py -> build/lib.linux-x86_64-3.7/osgeo copying osgeo/init.py -> build/lib.linux-x86_64-3.7/osgeo copying osgeo/osr.py -> build/lib.linux-x86_64-3.7/osgeo copying osgeo/ogr.py -> build/lib.linux-x86_64-3.7/osgeo copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.7/osgeo copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.7/osgeo copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.7/osgeo Fixing build/lib.linux-x86_64-3.7/gdal.py build/lib.linux-x86_64-3.7/ogr.py build/lib.linux-x86_64-3.7/osr.py build/lib.linux-x86_64-3.7/gdalconst.py build/lib.linux-x86_64-3.7/gdalnumeric.py build/lib.linux-x86_64-3.7/osgeo/gnm.py build/lib.linux-x86_64-3.7/osgeo/gdal.py build/lib.linux-x86_64-3.7/osgeo/init.py build/lib.linux-x86_64-3.7/osgeo/osr.py build/lib.linux-x86_64-3.7/osgeo/ogr.py build/lib.linux-x86_64-3.7/osgeo/gdal_array.py build/lib.linux-x86_64-3.7/osgeo/gdalnumeric.py build/lib.linux-x86_64-3.7/osgeo/gdalconst.py Skipping optional fixer: ws_comma Fixing build/lib.linux-x86_64-3.7/gdal.py build/lib.linux-x86_64-3.7/ogr.py build/lib.linux-x86_64-3.7/osr.py build/lib.linux-x86_64-3.7/gdalconst.py build/lib.linux-x86_64-3.7/gdalnumeric.py build/lib.linux-x86_64-3.7/osgeo/gnm.py build/lib.linux-x86_64-3.7/osgeo/gdal.py build/lib.linux-x86_64-3.7/osgeo/init.py build/lib.linux-x86_64-3.7/osgeo/osr.py build/lib.linux-x86_64-3.7/osgeo/ogr.py build/lib.linux-x86_64-3.7/osgeo/gdal_array.py build/lib.linux-x86_64-3.7/osgeo/gdalnumeric.py build/lib.linux-x86_64-3.7/osgeo/gdalconst.py Skipping optional fixer: ws_comma running build_ext Traceback (most recent call last): File "setup.py", line 430, in setup(setup_kwargs) File "/home/planetobserver/Téléchargements/artifacts/MAJA/install/maja/4.2.1/lib/python3.7/site-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(attrs) File "/home/planetobserver/Téléchargements/artifacts/MAJA/install/maja/4.2.1/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/home/planetobserver/Téléchargements/artifacts/MAJA/install/maja/4.2.1/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/home/planetobserver/Téléchargements/artifacts/MAJA/install/maja/4.2.1/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/planetobserver/Téléchargements/artifacts/MAJA/install/maja/4.2.1/lib/python3.7/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/home/planetobserver/Téléchargements/artifacts/MAJA/install/maja/4.2.1/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/planetobserver/Téléchargements/artifacts/MAJA/install/maja/4.2.1/lib/python3.7/distutils/dist.py", line 984, in run_command cmd_obj.ensure_finalized() File "/home/planetobserver/Téléchargements/artifacts/MAJA/install/maja/4.2.1/lib/python3.7/distutils/cmd.py", line 107, in ensure_finalized self.finalize_options() File "setup.py", line 287, in finalize_options self.gdaldir = self.get_gdal_config('prefix') File "setup.py", line 237, in get_gdal_config return fetch_config(option, gdal_config=self.gdal_config) File "setup.py", line 155, in fetch_config r = p.stdout.readline().decode('ascii').strip() UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 22: ordinal not in range(128) make[5]: [GNUmakefile:73 : build] Erreur 1 make[4]: [GNUmakefile:29 : build] Erreur 2 make[3]: [GNUmakefile:122 : swig-modules] Erreur 2 make[2]: [CMakeFiles/GDAL.dir/build.make:130 : GDAL/stamp/GDAL-build] Erreur 2 make[1]: [CMakeFiles/Makefile2:268 : CMakeFiles/GDAL.dir/all] Erreur 2 make: [Makefile:95 : all] Erreur 2 planetobserver@planetlinux:~/Téléchargements/artifacts/MAJA/build$

` I'll be gratefull if you have any suggestions to fix that ^^ Thank you, Aafaf

aafaf-arharas commented 2 years ago

Here is the Gdal files : GDAL-configure-err.log

jerome-colin commented 2 years ago

Hi, Seems like it crashed at build step. Can you provide any GDAL-build-out.log ? Thanks, Jerome

jerome-colin commented 2 years ago

Just in case you keep having troubles compiling, you can get build artifacts of the latest 4.2.7 from here (linux only): https://gitlab.orfeo-toolbox.org/maja/maja/-/jobs/45122/artifacts/download?file_type=archive

aafaf-arharas commented 2 years ago

Hi Jerome, I can't find the file GDAL-build-out.log or GDAL-build-err.log in the stamp folder. I worked with the latest version and still get the same error while compiling :( Aafaf