Compiling gsa 8 from source

I am trying to compile gsa 9.0 from source. Prerequisites are installed. To compile I did:

git clone https://github.com/greenbone/gsa.git
cd gsa
mkdir BUILD
cd BUILD
cmake …
make

cmake went fine:

$ cmake …
– Configuring Greenbone Security Assistant…
– The C compiler identification is GNU 6.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Found Git: /usr/bin/git (found version “2.11.0”)
– Install prefix: /usr/local
– Found Node: /usr/local/bin/node (found suitable version “11.0.0-pre”, minimum required is “8.0”)
– Found Yarn: /usr/bin/yarn
– Could NOT find Gettext (missing: GETTEXT_MSGMERGE_EXECUTABLE
GETTEXT_MSGFMT_EXECUTABLE)
– Found PythonInterp: /usr/bin/python (found version “2.7.13”)
– Could NOT find PY_polib (missing: PY_POLIB)

CMake Warning at gsa/po/CMakeLists.txt:119 (message):
Could not build translation files: gettext not found.
– Found PkgConfig: /usr/bin/pkg-config (found version “0.29”)
– Checking for module ‘libmicrohttpd>=0.9.0’
– Found libmicrohttpd, version 0.9.51
– Checking for module ‘libxml-2.0’
– Found libxml-2.0, version 2.9.4
– Checking for module ‘glib-2.0>=2.42’
– Found glib-2.0, version 2.50.3
– Checking for module ‘libgvm_base>=1.0.0’
– Found libgvm_base, version 1.0.0
– Checking for module ‘libgvm_util>=1.0.0’
– Found libgvm_util, version 1.0.0
– Checking for module ‘libgvm_gmp>=1.0.0’
– Found libgvm_gmp, version 1.0.0
– Checking for module ‘gnutls>=3.2.15’
– Found gnutls, version 3.5.8
– Looking for libgcrypt…
– Looking for libgcrypt… /usr/lib/x86_64-linux-gnu/libgcrypt.so
– Looking for pthread.h
– Looking for pthread.h - found
– Looking for pthread_create
– Looking for pthread_create - not found
– Looking for pthread_create in pthreads
– Looking for pthread_create in pthreads - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - found
– Found Threads: TRUE
– Found Doxygen: /usr/bin/doxygen (found version “1.8.13”)
– Looking for xmltoman…
– Looking for xmltoman… /usr/bin/xmltoman
– Looking for xmlmantohtml… /usr/bin/xmlmantohtml
– Configuring done
– Generating done
– Build files have been written to: /home/xxx/src/gsm/9/gsa/BUILD

Afterwards make failed:

$ LANG=CC make
[ 6%] Install gsa-ng js dependencies
ERROR: [Errno 2] No such file or directory: ‘install’
gsa/CMakeFiles/gsa-ng.dir/build.make:62: recipe for target ‘gsa/node-modules.stamp’ failed
make[2]: *** [gsa/node-modules.stamp] Error 1
CMakeFiles/Makefile2:87: recipe for target ‘gsa/CMakeFiles/gsa-ng.dir/all’ failed
make[1]: *** [gsa/CMakeFiles/gsa-ng.dir/all] Error 2
Makefile:149: recipe for target ‘all’ failed
make: *** [all] Error 2

gettext is not there, or better: in an inadequate version. All others warned about that, but ignored it then.
File gsa/node-modules.stamp is not found. At least not within directory BUILD. I could not find it in BUILDs parent to. Do I have to compile anything before?

I could successfully compile and install (all checked out from https://github.com/greenbone/):

  1. gvm-libs
  2. gvm-tools
  3. gvm
  4. openvas-scanner
  5. openvas-smb

Am I missing something? Do I have to compile an other part of gsm before compiling gsa, so ‘node-modules.stamp’ exists?

Could you run make VERBOSE=1 in the BUILD dir?

1 Like

$ LANG=CC make VERBOSE=1
/usr/bin/cmake -H/home/xxx/src/gsm/9/gsa -B/home/xxx/src/gsm/9/gsa/BUILD --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/xxx/src/gsm/9/gsa/BUILD/CMakeFiles /home/xxx/src/gsm/9/gsa/BUILD/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory ‘/home/xxx/src/gsm/9/gsa/BUILD’
make -f gsa/CMakeFiles/gsa-ng.dir/build.make gsa/CMakeFiles/gsa-ng.dir/depend
make[2]: Entering directory ‘/home/xxx/src/gsm/9/gsa/BUILD’
cd /home/xxx/src/gsm/9/gsa/BUILD && /usr/bin/cmake -E cmake_depends “Unix Makefiles” /home/xxx/src/gsm/9/gsa /home/xxx/src/gsm/9/gsa/gsa /home/xxx/src/gsm/9/gsa/BUILD /home/xxx/src/gsm/9/gsa/BUILD/gsa /home/xxx/src/gsm/9/gsa/BUILD/gsa/CMakeFiles/gsa-ng.dir/DependInfo.cmake --color=
make[2]: Leaving directory ‘/home/xxx/src/gsm/9/gsa/BUILD’
make -f gsa/CMakeFiles/gsa-ng.dir/build.make gsa/CMakeFiles/gsa-ng.dir/build
make[2]: Entering directory ‘/home/xxx/src/gsm/9/gsa/BUILD’
[ 4%] Install gsa-ng js dependencies
cd /home/xxx/src/gsm/9/gsa/gsa && /usr/bin/yarn install
ERROR: [Errno 2] No such file or directory: ‘install’
gsa/CMakeFiles/gsa-ng.dir/build.make:62: recipe for target ‘gsa/node-modules.stamp’ failed
make[2]: *** [gsa/node-modules.stamp] Error 1
make[2]: Leaving directory ‘/home/xxx/src/gsm/9/gsa/BUILD’
CMakeFiles/Makefile2:87: recipe for target ‘gsa/CMakeFiles/gsa-ng.dir/all’ failed
make[1]: *** [gsa/CMakeFiles/gsa-ng.dir/all] Error 2
make[1]: Leaving directory ‘/home/xxx/src/gsm/9/gsa/BUILD’
Makefile:149: recipe for target ‘all’ failed
make: *** [all] Error 2

$ ll
insgesamt 76K
drwxr-xr-x 1 xxx xxx 252 Okt 8 19:04 ./
drwxr-xr-x 1 xxx xxx 224 Okt 8 19:04 …/
-rw-r–r-- 1 xxx xxx 25K Okt 8 19:04 CMakeCache.txt
drwxr-xr-x 1 xxx xxx 414 Okt 9 08:47 CMakeFiles/
-rw-r–r-- 1 xxx xxx 3,7K Okt 8 19:04 CPackConfig.cmake
-rw-r–r-- 1 xxx xxx 3,9K Okt 8 19:04 CPackSourceConfig.cmake
-rw-r–r-- 1 xxx xxx 14K Okt 8 19:04 Makefile
-rw-r–r-- 1 xxx xxx 1 Okt 8 19:04 VERSION
-rw-r–r-- 1 xxx xxx 1,7K Okt 8 19:04 cmake_install.cmake
-rw-r–r-- 1 xxx xxx 15K Okt 8 19:04 compile_commands.json
drwxr-xr-x 1 xxx xxx 78 Okt 8 19:04 gsa/
drwxr-xr-x 1 xxx xxx 86 Okt 8 19:04 gsad/

True: there is no directory or file “install”, while “install” exists:

$ LANG=CC install --version
install (GNU coreutils) 8.26
Copyright © 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

Something is wrong either with the yarn executable or your source directory. Could you paste your yarn version via running yarn --version? You could also try to run cd /home/xxx/src/gsm/9/gsa/gsa && /usr/bin/yarn install manually.

1 Like

$ yarn --version
0.27

$ pwd
/home/xxx/src/gsm/9/gsa/gsa
$ /usr/bin/yarn install
ERROR: [Errno 2] No such file or directory: ‘install’

Not sure why this version of yarn doesn’t support install. Can’t remember any version that didn’t work this way but nevertheless your version is really really old. Current version is 1.10. So could you update yarn please?

1 Like

You will need at least yarn 1.0 to work as expected

1 Like

yarn 1.0 will be required for gsa 8.0 in future

1 Like

With yarn (latest) it is working.