flatironinstitute / slurm-prometheus-exporter

Prometheus exporter for slurm job/node data
31 stars 7 forks source link

Error when building #5

Open Lormen opened 2 years ago

Lormen commented 2 years ago

Hi,

I've managed to edit a few things to get close to being able to compile this (reverted changes from issue #2 as we're using slurm 19.05, removed the slurmdb) but it still won't build:

stack install --flag slurm-prometheus-exporter:-pkgconfig --extra-lib-dirs=/opt/slurm/lib/slurm --extra-include-dirs=/opt/slurm/include/slurm
Building all executables for `slurm-prometheus-exporter' once. After a successful build of all of them, only specified executables will be rebuilt.
slurm-prometheus-exporter> build (exe)
Preprocessing executable 'slurm-exporter' for slurm-prometheus-exporter-0.2.0.0..
Building executable 'slurm-exporter' for slurm-prometheus-exporter-0.2.0.0..
Linking .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter ...
.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter-tmp/Slurm/Init.o(.text+0x53): error: undefined reference to 'slurm_init'
.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter-tmp/Slurm/Init.o:function SlurmziInit_initSlurm1_info: error: undefined reference to 'slurm_init'
.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter-tmp/Slurm/Init.o:function SlurmziInit_finiSlurm1_info: error: undefined reference to 'slurm_fini'
.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter-tmp/Slurm/Init.o:function SlurmziInit_withSlurm2_info: error: undefined reference to 'slurm_fini'
.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter-tmp/Slurm/Init.o(.text+0x315): error: undefined reference to 'slurm_init'
.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter-tmp/Slurm/Init.o(.text+0x3c7): error: undefined reference to 'slurm_fini'
.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter-tmp/Slurm/Init.o(.text+0x3ef): error: undefined reference to 'slurm_fini'
.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/build/slurm-exporter/slurm-exporter-tmp/Slurm/Init.o:function SlurmziInit_withSlurm1_info: error: undefined reference to 'slurm_init'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

--  While building package slurm-prometheus-exporter-0.2.0.0 (scroll up to its section to see the error) using:
      /root/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.4 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0 build exe:slurm-exporter --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

Any ideas?