chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.79k stars 421 forks source link

Error finding "event2" on Ubuntu #8494

Closed buddha314 closed 6 years ago

buddha314 commented 6 years ago

Here is the build command and failure

 make
chpl -M/home/buddha314/chingon/src -M/home/buddha314/cdo/src -M/home/buddha314/numsuch/src -M/home/buddha314/chrest/src --fast --pri
nt-callstack-on-error -I/opt/OpenBLAS/include -I/usr/include/postgresql -L/opt/OpenBLAS/lib -lblas  -o bin/ayatollah src/Ayatollah.c
hpl
In file included from /tmp/chpl-buddha314-18591.deleteme/_main.c:2:0:
/tmp/chpl-buddha314-18591.deleteme/chpl__header.h:9:27: fatal error: event2/buffer.h: No such file or directory
 #include "event2/buffer.h"
                           ^
compilation terminated.
/home/buddha314/chapel/runtime/etc/Makefile.exe:27: recipe for target '/tmp/chpl-buddha314-18591.deleteme/ayatollah.tmp' failed
make[1]: *** [/tmp/chpl-buddha314-18591.deleteme/ayatollah.tmp] Error 1
error: compiling generated source
Makefile:14: recipe for target 'default' failed
make: *** [default] Error 1

The header seems to be here on my Ubuntu machine

buddha314@notes:~/ayatollah$ locate buffer.h | grep event
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include/event2/buffer.h
buddha314 commented 6 years ago

Adding this to the Makefile got me on to the next error

-I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include

which was

In file included from /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include/event2/buffer.h
:87:0,
                 from /tmp/chpl-buddha314-22336.deleteme/chpl__header.h:9,
                 from /tmp/chpl-buddha314-22336.deleteme/_main.c:2:
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include/event2/util.h:41:25: fatal error: opa
l_rename.h: No such file or directory
 #include "opal_rename.h"
                         ^
compilation terminated.
/home/buddha314/chapel/runtime/etc/Makefile.exe:27: recipe for target '/tmp/chpl-buddha314-22336.deleteme/ayatollah.tmp' failed
make[1]: *** [/tmp/chpl-buddha314-22336.deleteme/ayatollah.tmp] Error 1
error: compiling generated source
Makefile:14: recipe for target 'default' failed

So there appears to be an institutional problem with openmpi on Ubuntu. Anyone know this one?

mppf commented 6 years ago

apt-get install libevent-dev

buddha314 commented 6 years ago

I'm not THAT clueless, I tried that already. :) But it does seems that should have been the solution. Still gebrokun.

mppf commented 6 years ago

I can has an Ubuntu 17.10. I do this:

sudo apt-get install libevent-dev

and things happen and then I do

find /usr/include -name buffer.h

which outputs

/usr/include/openssl/buffer.h
/usr/include/event2/buffer.h

AFAIK, if you don't have /usr/include/event2/buffer.h on your system, libevent-dev is not correctly installed.

It wouldn't surprise me greatly if openmpi is bundling libevent in a way that is incompatible with using the regular installation of the library. But so far it sounds like the regular installation isn't there, yet.

buddha314 commented 6 years ago

I agree it's probably an installation thing, but I don't know how to track it down.


buddha314@notes:~/ayatollah$ find /usr/include -name buffer.h
/usr/include/nettle/buffer.h
/usr/include/event2/buffer.h
/usr/include/openssl/buffer.h

and

locate opal_rename.h
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/opal_rename.h
mppf commented 6 years ago

Can you show output of printchplenv and the compilation command that failed, with --print-commands added to it?

buddha314 commented 6 years ago

Ack, that's the command. Honestly, I couldn't remember it. Maybe it should be chpl-printenv or something.

printchplenv
machine info: Linux notes 4.10.0-42-generic #46-Ubuntu SMP Mon Dec 4 14:38:01 UTC 2017 x86_64
CHPL_HOME: /home/buddha314/chapel *
script location: /home/buddha314/chapel/util
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: intrinsics
CHPL_GMP: gmp
CHPL_HWLOC: hwloc
CHPL_REGEXP: re2
CHPL_AUX_FILESYS: none

And

> make
chpl -M/home/buddha314/chingon/src -M/home/buddha314/cdo/src -M/home/buddha314/numsuch/src -M/home/buddha314/chrest/src --fast --pri
nt-callstack-on-error -I/opt/OpenBLAS/include -I/usr/include/postgresql -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca
/event/libevent2022/libevent/include -L/opt/OpenBLAS/lib -lblas  -o bin/ayatollah src/Ayatollah.chpl
mppf commented 6 years ago

Can you show the output of chpl --print-commands with your command line? Why are you using OpenMPI at all?

buddha314 commented 6 years ago

As you wish!

make
chpl -M/home/buddha314/chingon/src -M/home/buddha314/cdo/src -M/home/buddha314/numsuch/src -M/home/buddha314/chrest/src --fast --pri
nt-callstack-on-error --print-commands -I/opt/OpenBLAS/include -I/usr/include/postgresql -I/usr/lib/x86_64-linux-gnu/openmpi/include
/openmpi/opal/mca/event/libevent2022/libevent/include -L/opt/OpenBLAS/lib -lblas  -o bin/ayatollah src/Ayatollah.chpl
make[1]: Entering directory '/home/buddha314/ayatollah'
gcc    -I/home/buddha314/chapel/third-party/qthread/install/linux64-gnu-native-flat/include -I/home/buddha314/chapel/third-party/hwl
oc/install/linux64-gnu-native-flat/include    -DCHPL_TASKS_MODEL_H=\"tasks-qthreads.h\" -DCHPL_THREADS_MODEL_H=\"threads-none.h\"  -
DCHPL_OPTIMIZE -DNDEBUG -DCHPL_JEMALLOC_PREFIX=chpl_je_ -DCHPL_HAS_GMP  -Wno-unused -Wno-uninitialized -Wno-pointer-sign -Wno-tautol
ogical-compare -Wno-strict-overflow -O3 -march=native -I/opt/OpenBLAS/include -I/usr/include/postgresql -I/usr/lib/x86_64-linux-gnu/
openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include  -c -o /tmp/chpl-buddha314-90514.deleteme/ayatollah.tmp.o -I/ho
me/buddha314/chapel/third-party/qthread/install/linux64-gnu-native-flat/include -I. -I/home/buddha314/chapel/modules/packages -I/hom
e/buddha314/chapel/runtime/include/localeModels/flat -I/home/buddha314/chapel/runtime/include/localeModels -I/home/buddha314/chapel/
runtime/include/comm/none -I/home/buddha314/chapel/runtime/include/comm -I/home/buddha314/chapel/runtime/include/tasks/qthreads -I/h
ome/buddha314/chapel/runtime/include/threads/none -I/home/buddha314/chapel/runtime/include -I/home/buddha314/chapel/runtime/include/
qio -I/home/buddha314/chapel/runtime/include/atomics/intrinsics -I/home/buddha314/chapel/runtime/include/mem/jemalloc -I/home/buddha
314/chapel/third-party/utf8-decoder -I/home/buddha314/chapel/runtime//../build/runtime/linux64/gnu/arch-native/loc-flat/comm-none/ta
sks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-intrinsics/gmp-gmp/hwloc/re2/fs-none/include  -I/home/buddha314/chapel/thi
rd-party/jemalloc/install/linux64-gnu-native/include -I/home/buddha314/chapel/third-party/gmp/install/linux64-gnu-native/include -I/
home/buddha314/chapel/third-party/hwloc/install/linux64-gnu-native-flat/include /tmp/chpl-buddha314-90514.deleteme/_main.c
In file included from /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include/event2/buffer.h
:87:0,
                 from /tmp/chpl-buddha314-90514.deleteme/chpl__header.h:9,
                 from /tmp/chpl-buddha314-90514.deleteme/_main.c:2:
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include/event2/util.h:41:25: fatal error: opa
l_rename.h: No such file or directory
 #include "opal_rename.h"
                         ^
compilation terminated.
/home/buddha314/chapel/runtime/etc/Makefile.exe:27: recipe for target '/tmp/chpl-buddha314-90514.deleteme/ayatollah.tmp' failed
make[1]: *** [/tmp/chpl-buddha314-90514.deleteme/ayatollah.tmp] Error 1
make[1]: Leaving directory '/home/buddha314/ayatollah'
error: compiling generated source
Makefile:14: recipe for target 'default' failed
make: *** [default] Error 1

I think the CDO library may need it. I'm using that module.

mppf commented 6 years ago

What if you put -I /usr/include before the other includes on the chpl command line?

I think that you're finding an OpenMPI specific version of event2/buffer.h rather than the standardly installed one. I think "opal" is some OpenMPI component.

mppf commented 6 years ago

Or, can you remove the -I/usr/lib/x86_64-linux-gnu/openmpi/include /openmpi/opal/mca/event/libevent2022/libevent/include from your chpl command?

buddha314 commented 6 years ago

By your command!

make
chpl -M/home/buddha314/chingon/src -M/home/buddha314/cdo/src -M/home/buddha314/numsuch/src -M/home/buddha314/chrest/src --fast --pri
nt-callstack-on-error --print-commands -I/usr/include -I/opt/OpenBLAS/include -I/usr/include/postgresql  -L/opt/OpenBLAS/lib -lblas
 -o bin/ayatollah src/Ayatollah.chpl
make[1]: Entering directory '/home/buddha314/ayatollah'
gcc    -I/home/buddha314/chapel/third-party/qthread/install/linux64-gnu-native-flat/include -I/home/buddha314/chapel/third-party/hwl
oc/install/linux64-gnu-native-flat/include    -DCHPL_TASKS_MODEL_H=\"tasks-qthreads.h\" -DCHPL_THREADS_MODEL_H=\"threads-none.h\"  -
DCHPL_OPTIMIZE -DNDEBUG -DCHPL_JEMALLOC_PREFIX=chpl_je_ -DCHPL_HAS_GMP  -Wno-unused -Wno-uninitialized -Wno-pointer-sign -Wno-tautol
ogical-compare -Wno-strict-overflow -O3 -march=native -I/usr/include -I/opt/OpenBLAS/include -I/usr/include/postgresql  -c -o /tmp/c
hpl-buddha314-92194.deleteme/ayatollah.tmp.o -I/home/buddha314/chapel/third-party/qthread/install/linux64-gnu-native-flat/include -I
. -I/home/buddha314/chapel/modules/packages -I/home/buddha314/chapel/runtime/include/localeModels/flat -I/home/buddha314/chapel/runt
ime/include/localeModels -I/home/buddha314/chapel/runtime/include/comm/none -I/home/buddha314/chapel/runtime/include/comm -I/home/bu
ddha314/chapel/runtime/include/tasks/qthreads -I/home/buddha314/chapel/runtime/include/threads/none -I/home/buddha314/chapel/runtime
/include -I/home/buddha314/chapel/runtime/include/qio -I/home/buddha314/chapel/runtime/include/atomics/intrinsics -I/home/buddha314/
chapel/runtime/include/mem/jemalloc -I/home/buddha314/chapel/third-party/utf8-decoder -I/home/buddha314/chapel/runtime//../build/run
time/linux64/gnu/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-intrinsics/gmp-gmp/hwloc
/re2/fs-none/include  -I/home/buddha314/chapel/third-party/jemalloc/install/linux64-gnu-native/include -I/home/buddha314/chapel/thir
d-party/gmp/install/linux64-gnu-native/include -I/home/buddha314/chapel/third-party/hwloc/install/linux64-gnu-native-flat/include /t
mp/chpl-buddha314-92194.deleteme/_main.c
g++ -L/home/buddha314/chapel/third-party/qthread/install/linux64-gnu-native-flat/lib -Wl,-rpath,/home/buddha314/chapel/third-party/q
thread/install/linux64-gnu-native-flat/lib -L/home/buddha314/chapel/third-party/jemalloc/install/linux64-gnu-native/lib -L/home/budd
ha314/chapel/third-party/gmp/install/linux64-gnu-native/lib -Wl,-rpath,/home/buddha314/chapel/third-party/gmp/install/linux64-gnu-na
tive/lib -L/home/buddha314/chapel/third-party/hwloc/install/linux64-gnu-native-flat/lib -Wl,-rpath,/home/buddha314/chapel/third-part
y/hwloc/install/linux64-gnu-native-flat/lib -L/home/buddha314/chapel/third-party/re2/install/linux64-gnu-native/lib -Wl,-rpath,/home
/buddha314/chapel/third-party/re2/install/linux64-gnu-native/lib   -o /tmp/chpl-buddha314-92194.deleteme/ayatollah.tmp -L/home/buddh
a314/chapel/lib/linux64/gnu/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-intrinsics/gm
p-gmp/hwloc/re2/fs-none /tmp/chpl-buddha314-92194.deleteme/ayatollah.tmp.o  /home/buddha314/chapel/lib/linux64/gnu/arch-native/loc-f
lat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-intrinsics/gmp-gmp/hwloc/re2/fs-none/main.o  -lchpl -lm -L
/opt/OpenBLAS/lib -lblas -lpq -levent -lgmp -lchpl -lqthread -L/home/buddha314/chapel/third-party/hwloc/install/linux64-gnu-native-f
lat/lib -L/home/buddha314/chapel/third-party/jemalloc/install/linux64-gnu-native/lib -ljemalloc -lhwloc -lm -lre2 -lpthread
rm -f bin/ayatollah
mv /tmp/chpl-buddha314-92194.deleteme/ayatollah.tmp bin/ayatollah
make[1]: Leaving directory '/home/buddha314/ayatollah'
buddha314 commented 6 years ago

So... is -I /usr/include not the default?

mppf commented 6 years ago

That's really a C compiler question that I don't know the answer to. Did you try removing the OpenMPI -I ? I think it's likely that's not supposed to be there, but I don't really know.

buddha314 commented 6 years ago

Ack, I suck! I forgot the punchline...

Rectum?  Damn near KILLED 'EM!!`

And it compiled. Thanks Mike!

mppf commented 6 years ago

I got the punchline, just was trying to answer your other question. Anyway, I'll close the issue. (But you can keep commenting...)