lumol-org / lumol

Universal extensible molecular simulation engine
http://lumol.org/
BSD 3-Clause "New" or "Revised" License
184 stars 18 forks source link

Fails to build from source #269

Open vedranmiletic opened 5 months ago

vedranmiletic commented 5 months ago

I am a GROMACS contributor and I am very curious about Lumol. I tried to compile it with Rust 1.75 and 1.76 nightly and I get the following error:

/home/vedran/workspace/lumol/target/debug/build/chemfiles-sys-7ef0e8e38b1e6bbe/out/build/chemfiles/external/xdrfile/src/xdrfile.c:2020:5: error: incompatible function pointer types initializing 'unsigned int (*)(XDR *)' (aka 'unsigned int (*)(struct XDR *)') with an expression of type 'int64_t (XDR *)' (aka 'long (struct XDR *)') [-Wincompatible-function-pointer-types]
xdrstdio_getpos,   /* get offset in the stream */
^~~~~~~~~~~~~~~
/home/vedran/workspace/lumol/target/debug/build/chemfiles-sys-7ef0e8e38b1e6bbe/out/build/chemfiles/external/xdrfile/src/xdrfile.c:2021:5: error: incompatible function pointer types initializing 'int (*)(XDR *, unsigned int)' (aka 'int (*)(struct XDR *, unsigned int)') with an expression of type 'int(XDR *, int64_t, int)' (aka 'int (struct XDR *, long, int)') [-Wincompatible-function-pointer-types]
xdrstdio_setpos,   /* set offset in the stream */
^~~~~~~~~~~~~~~
2 errors generated.
gmake[2]: *** [/home/vedran/workspace/lumol/target/debug/build/chemfiles-sys-7ef0e8e38b1e6bbe/out/build/chemfiles/external/xdrfile/CMakeFiles/xdrfile.dir/build.make:76: /home/vedran/workspace/lumol/target/debug/build/chemfiles-sys-7ef0e8e38b1e6bbe/out/build/chemfiles/external/xdrfile/CMakeFiles/xdrfile.dir/src/xdrfile.c.o] Greška 1
gmake[1]: *** [CMakeFiles/Makefile2:541: chemfiles/external/xdrfile/CMakeFiles/xdrfile.dir/all] Greška 2
gmake[1]: *** Čeka se na nedovršene poslove....
gmake: *** [Makefile:136: all] Greška 2
thread 'main' panicked at /home/vedran/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

command did not execute successfully, got: exit status: 2

build script failed, must exit now
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: cmake::fail
3: cmake::run
4: cmake::Config::build
5: build_script_build::build_chemfiles
6: build_script_build::main
7: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This is on FreeBSD 14, but it doesn't seem like a FreeBSD-specific error. Any ideas why would chemfiles be incompatible with its own bundled xdrfile?

Luthaf commented 5 months ago

That might just be an issue with older chemfiles on freebsd. I haven't been able to work on lumol for a long time, and everything here is a bit outdated. I'll try updating chemfiles to the latest release to see if this fixes it!

Luthaf commented 5 months ago

Ok, I've updated chemfiles and other dependencies, it should now hopefully build for you.

vedranmiletic commented 5 months ago

Thanks for a quick response!

Indeed, now it goes a bit further, but still fails with:

error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/local/lib/rustlib/x86_64-unknown-freebsd/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/vedran/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcQevRot/symbols.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.130h5kqru05rr8ro.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.1at30heg74g0c2e6.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.1i3t0v8r5eovt8vj.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.1rf7p6t4islwzwf7.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.1u8rl6lsr3p3dpit.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.1xryfs9kll1oodc8.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.2bmpnjz8x0gouyd8.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.2f8oqycsmsj89qmw.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.2i78pzqw1dsn6pmp.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.2jbuyonqavws4azb.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.2jvx05fzg5k6f6ty.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.2o87ebjjf4fh5n9u.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.2z2zzq4840jebj7x.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.333mnlbd9ink2huc.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.33zwh5esq91ad59j.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.34gt9qo0e7v22al3.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.3bryiswb1dwv74ww.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.3mrsup8gfa2uevuy.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.3pgb3c7fvmp3m4qu.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.3sp3tqxb4at5woxg.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.3u17y5s5i7efzlbo.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.3vjgecv7nj2ql6ou.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.42crbf2a4k5j2db.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.49ot3tup8v2b9jzp.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.4fedee36eiilwvig.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.4g0obb2c07nas7l9.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.4gjz8bbdqs0xmrnq.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.4ladmqfdpbwexkpq.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.bdl61ul540324pg.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.nusywcdkjx7nuk1.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.xiz33lq7q3cia4x.rcgu.o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25.3uocuac4x8tt97mx.rcgu.o" "-Wl,--as-needed" "-L" "/home/vedran/workspace/lumol/target/debug/deps" "-L" "/home/vedran/workspace/lumol/target/debug/build/chemfiles-sys-566666270bf800cd/out/lib" "-L" "/usr/lib" "-L" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib" "-Wl,-Bstatic" "/home/vedran/workspace/lumol/target/debug/deps/liblumol-af24433331c132e4.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblumol_input-37d7d2fd51f4db1a.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblog4rs-97bcb8cb8811fa59.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblog_mdc-f32789b18930b5ee.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libthread_id-24de1b0ff188da02.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libanyhow-bc4ac4a1ed9e7f7b.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libthiserror-19aeceee9f60fb50.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libparking_lot-5c188b5b8017e01d.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libparking_lot_core-e59680b1eb07a763.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libsmallvec-ca4d3571a5c8c098.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblock_api-3a514ecfd18b7934.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libscopeguard-8385fde059363cfb.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libfnv-4a7da0919bab09e2.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libarc_swap-695b13bf5232f654.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libtoml-1897ab00d34c1f12.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libtoml_edit-cf0a0f7f3c25723d.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libserde_spanned-b8fc01c6e398616c.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libindexmap-28a06835edde9fd9.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libequivalent-537bbbe1e7eef26d.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libhashbrown-7709bd1844a1e2ed.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libwinnow-1b85482073adf75b.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libtoml_datetime-3f503e58728e265f.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libserde-9f5bc48fac903a6b.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblumol_sim-aa7dfc0fb3f2a502.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librand_xorshift-3fef059075d90afb.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librand_distr-808287e556768a65.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librand-89723c19071fa17c.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librand_chacha-fce2e506fce70542.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libppv_lite86-172b9fb161880884.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librand_core-bd36663fd3fcb664.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libgetrandom-7dd9bba8dd49d75f.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libcaldyn-cfd5c135bc73a1b7.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblumol_core-5ae317d98aec2667.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libndarray-7d07db1e2a0314cb.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libmatrixmultiply-088206204f9c97a2.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libnum_complex-f2545bb7e348f5c5.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libnum_integer-98d01c20e8a7feb2.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librawpointer-5ebc9ef366ab7a4f.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libchemfiles-fad81fdddc25de6e.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libchemfiles_sys-67207b92ccc9a731.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libbitflags-bafb7e17fbeb7729.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libsoa_derive-8b0073497c50b7d8.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libpermutation-c04f976f79a6410d.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librayon-938faddbd6e7b6ac.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librayon_core-0dd8e8bf28d6aa57.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libcrossbeam_deque-e2173b2dac5282b1.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libcrossbeam_epoch-9c1f5fdc882de003.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libcrossbeam_utils-d81d46f55b81eb0f.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libeither-226e3f8001646fff.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblog_once-02ef154c52f7dd30.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblazy_static-192e6184851990b5.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libspecial-2bd1d156852a9022.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblibm-793f12ecbfd756a2.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libthread_local-d1362bdf3bee472b.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libonce_cell-7051b6138c53b2cf.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblog-3752f34268c1f335.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libclap-d234d283a26bfc02.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libclap_builder-dc213f1daa455dab.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libstrsim-8bb31688261f44a7.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libanstream-8741da0b6bad9867.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libanstyle_query-a0cb7129e8cd0b44.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libcolorchoice-e3f0bb0e4c50c0ee.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libanstyle_parse-9939fe0a7485741d.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libutf8parse-f3ccd09581932eb3.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libclap_lex-2c0bf59f3bcaa105.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libanstyle-3c57e224ef964a94.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libchrono-035cb39a84b09ded.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libnum_traits-effd3fcbf008d0c3.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libiana_time_zone-c01ec3fcc96110ef.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libbacktrace-9ea7549e89b3c602.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libminiz_oxide-5b0e45bda437bbc3.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libadler-a905b27adb3df7ae.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libobject-7665aead2a5bc33a.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libmemchr-00caa8612e79ad09.rlib" "/home/vedran/workspace/lumol/target/debug/deps/liblibc-e5c91cb361609993.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libaddr2line-14585abcbd2c6883.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libgimli-f350de4a1c584736.rlib" "/home/vedran/workspace/lumol/target/debug/deps/libcfg_if-b4544ba88038e686.rlib" "/home/vedran/workspace/lumol/target/debug/deps/librustc_demangle-fc0684191aed3f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-749fc163998e3b57.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libpanic_unwind-3324aedb7da8df53.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libobject-bc443a8c9b6a5af6.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libmemchr-32aa4d6d2c594b5a.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libaddr2line-ed7601c080312510.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libgimli-0081e03f58ee1da7.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_demangle-d609ff5272dccaba.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libstd_detect-3a5ac86785f500b3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libhashbrown-32378335710e5990.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_alloc-1bdd891611287621.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libminiz_oxide-10783897338a5242.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libadler-a209363d25099528.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libunwind-5df04f060bbbbd80.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libcfg_if-24680301f326b512.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/liblibc-157fec8f38914dc1.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/liballoc-fa2699c8de87ae5a.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_core-9d191736d9334602.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libcore-5cc782c3786c4249.rlib" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib/libcompiler_builtins-86cbd9faabce4993.rlib" "-Wl,-Bdynamic" "-lc++" "-lm" "-lc" "-lgcc" "-lgcc_s" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lmemstat" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-ldevstat" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lmemstat" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-ldevstat" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib" "-o" "/home/vedran/workspace/lumol/target/debug/deps/lumol-ef1b8494ed028c25" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: ld: error: undefined symbol: lseek64
>>> referenced by gzlib.c
>>>               gzlib.c.o:(gz_open) in archive /home/vedran/workspace/lumol/target/debug/deps/libchemfiles_sys-67207b92ccc9a731.rlib
>>> referenced by gzlib.c
>>>               gzlib.c.o:(gz_open) in archive /home/vedran/workspace/lumol/target/debug/deps/libchemfiles_sys-67207b92ccc9a731.rlib
>>> referenced by gzlib.c
>>>               gzlib.c.o:(gzrewind) in archive /home/vedran/workspace/lumol/target/debug/deps/libchemfiles_sys-67207b92ccc9a731.rlib
>>> referenced 3 more times
cc: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile `lumol` (bin "lumol") due to previous error

Any ideas? I completely understand if Lumol is not your focus anymore and don't have time to look into it deeper.

Luthaf commented 5 months ago

Well, these are all chemfiles errors, on which I'm still working =). Let's open an issue over there (https://github.com/chemfiles/chemfiles.rs/issues/46) about this.

Luthaf commented 5 months ago

Ok, now that the chemfiles fix is published, you should be able to build lumol with a cargo update.