Closed sabaronett closed 3 years ago
From @hannorein (https://github.com/dtamayo/reboundx/issues/63#issuecomment-865410915)
derivatives.o: file not recognized: File truncated
That's a strange error. And it only shows up at the linking stage. I do not know what that could mean. ...
Updated stdout/stderr from compile attempt w/ reboundx 3.4.0, comp_err.txt.
hm, thanks for this bug report! I can't reproduce this locally. It makes a difference for linking etc. whether you install REBOUND and REBOUNDx from a local directory you cloned from GitHub (e.g., pip install -e .), or whether you've installed it from PyPI (pip install rebound). Which are you using for both REBOUND and REBOUNDx?
I guess if you're running the REBOUNDx C examples you have the directory cloned, but what about REBOUND?
It seems like you don't have the default setup REBOUNDx expects in order to find REBOUND, I.e., with the rebound and reboundx folders in the same directory. Have you set the REB_DIR environment variable? See the top of
https://reboundx.readthedocs.io/en/latest/c_quickstart.html#c-quickstart
Hmm, I didn't think about that. The PyPI versions of REBOUND/REBOUNDx are installed /home/stanley/miniconda3/envs/rebx-3.4.0
, but I don't think either of those get called when I run/compile the C examples.
I've also cloned the GH repos of REBOUND to ~/github/hannorein/rebound
and REBOUNDx to ~/github/dtamayo/reboundx
, and have the following in my .bashrc
:
# Separate REBOUND/REBOUNDx Directories
export REB_DIR=~/github/hannorein/rebound
The latter path gets invoked when I try to compile.
OK. Does it work for you if you do
make clean && make
(I.e. don't use -j option)
It could be that the corrupted file error occurs because different files were compiled with different compilers.
I don't see the derivatives.o file not recognized error in his txt file. I'm not sure if it's the same issue (?)
I can reproduce your error if I use -j. It might just be that we haven't been clever enough with the makefile to tell it how to to compile in parallel and it's trying to compile reboundx without first compiling rebound
Ha, make clean && make
works. I think you hit the bullseye there. I've developed a bad habit of using make -j
for all the work in Athena++ I've been doing, where compilation can take 5+ minutes.
Thanks for the tip! I'll close the issue.
Thanks Stanley. Yeah it's fast enough that we've never thought carefully about how to parallelize compilation. I can imagine that's important for Athena++! I'm excited to hear about your work with that
I'll remember to share with you whatever publication(s) come out of that work when the time comes!
Not sure if it's related, but I encounter errors when compiling
problem.c
for any of the Cexamples/*
; I'm able to run./rebound
only after a secondmake
in a row outputs the binary; see make_errors.txt.Originally posted by @sabaronett in https://github.com/dtamayo/reboundx/issues/63#issuecomment-865401885