swiss-seismological-service / scrtdd

Double Difference Relocator for SeisComP
27 stars 10 forks source link

Compiling error #45

Closed saeedsltm closed 3 years ago

saeedsltm commented 3 years ago

The following error occurred when compiling on Ubuntu 20.04, with Seiscomp(V4) source and "scrtdd" master version:

Scanning dependencies of target seiscomp_hdd
[ 63%] Building CXX object src/extras/scrtdd/libs/hdd/CMakeFiles/seiscomp_hdd.dir/utils.cpp.o
In file included from /home/saeed/Downloads/Compressed/seiscomp-master/src/extras/scrtdd/libs/hdd/utils.h:21,
                 from /home/saeed/Downloads/Compressed/seiscomp-master/src/extras/scrtdd/libs/hdd/utils.cpp:18:
/home/saeed/Downloads/Compressed/seiscomp-master/src/extras/scrtdd/libs/hdd/catalog.h:21:10: fatal error: seiscomp3/core/baseobject.h: No such file or directory
   21 | #include <seiscomp3/core/baseobject.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/extras/scrtdd/libs/hdd/CMakeFiles/seiscomp_hdd.dir/build.make:63: src/extras/scrtdd/libs/hdd/CMakeFiles/seiscomp_hdd.dir/utils.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:804: src/extras/scrtdd/libs/hdd/CMakeFiles/seiscomp_hdd.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
luca-s commented 3 years ago

Hi @saeedsltm, to be sure you are compiling a tested version of the code, could you please go in the scrtdd folder and checkout a specific scrtdd version? (e.g. to checkout the latest version run git checkout v1.2.4) Then let me know if you get the same error

saeedsltm commented 3 years ago

Dear @luca-s here is the output of git checkout v1.2.4:

(base) saeed@saeed-P453UJ:~/Downloads/Compressed/seiscomp-master/src/extras/scrtdd$ git checkout v1.2.4
Note: switching to 'v1.2.4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at c8ee6b4 Merge branch 'master' into new_agpl_seiscomp
(base) saeed@saeed-P453UJ:~/Downloads/Compressed/seiscomp-master/src/extras/scrtdd$ git status 
HEAD detached at v1.2.4
nothing to commit, working tree clean

and now a fresh compiling gives the following error:

Scanning dependencies of target seiscomp_rtddmsg
[ 64%] Building CXX object src/extras/scrtdd/libs/core/CMakeFiles/seiscomp_rtddmsg.dir/rtddmsg.cpp.o
In file included from /home/saeed/Downloads/Compressed/seiscomp-master/src/extras/scrtdd/libs/core/rtddmsg.cpp:18:
/home/saeed/Downloads/Compressed/seiscomp-master/src/extras/scrtdd/libs/core/rtddmsg.h:21:10: fatal error: seiscomp/client.h: No such file or directory
   21 | #include <seiscomp/client.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/extras/scrtdd/libs/core/CMakeFiles/seiscomp_rtddmsg.dir/build.make:63: src/extras/scrtdd/libs/core/CMakeFiles/seiscomp_rtddmsg.dir/rtddmsg.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:783: src/extras/scrtdd/libs/core/CMakeFiles/seiscomp_rtddmsg.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
luca-s commented 3 years ago

The following error occurred when compiling on Ubuntu 20.04, with Seiscomp(V4) sourc

What version of Seiscomp(V4) are you compiling? v4.4.0? or did you checkout the development master branch of SeisComP?

saeedsltm commented 3 years ago

I've downloaded the latest version (master which is v4.4) directly from GitHub address into my Download directory and the clone the scrtdd source into seiscomp/scr/extra.

luca-s commented 3 years ago

Did you download all the sub-modules too? It seems you are missing some parts of SeisComP

From the readme

#!/bin/bash

if [ $# -eq 0 ]
then
    echo "$0 <target-directory>"
    exit 1
fi

target_dir=$1
repo_path=https://github.com/SeisComP

echo "Cloning base repository into $1"
git clone $repo_path/seiscomp.git $1

echo "Cloning base components"
cd $1/src/base
git clone $repo_path/seedlink.git
git clone $repo_path/common.git
git clone $repo_path/main.git
git clone $repo_path/extras.git

echo "Cloning external base components"
git clone $repo_path/contrib-gns.git
git clone $repo_path/contrib-ipgp.git
git clone $repo_path/contrib-sed.git

echo "Done"

cd ../../

echo "If you want to use 'mu', call 'mu register --recursive'"
echo "To initialize the build, run 'make'."
saeedsltm commented 3 years ago

Dear @luca-s , thanks for your help. i used the above script and the problem was solved.