Indeed, the problem goes away when -static flag is omitted. Interestingly, the resulting binary dependencies do not include any ccp4-related libraries. For those interested, I was able to track the segfault down to the close() operator - so basically it fails when closing a file opened with ccpdpn routine. At that point I had a lucky guess of removing the flag (somewhat inspired by noticing that refmac5 binary from cc4-6.3.0 is dynamic and after trying to compile separately a short piece of code that only opened and closed a file), so the issue is solved as far as my goals are concerned.
On Mon, 2013-03-04 at 10:04 +0000, Garib N Murshudov wrote: > Dear all > > > I think this error has been dealt with (Ed will correct me if I am > wrong). The problem was -static in compilation. For whatever reason in > some gcc (gfortran) -static does not work (it compiles but has > problems in running, what is the reason is not clear to me). Sometimes > in later gcc -static-libgcc -static-libgfortran works but not always. > These flags are needed for distribution purposes. If you are compiling > and using on the same computer then you should not need it. > > > regards > Garib > > > > On 4 Mar 2013, at 09:56, Adam Ralph wrote: > > > Dear Ed, > > > > > > The error does indeed happen in ccp4lib. One of the first > > routines called by CCP4 > > progs is "ccp4fyp". This initialises the CCP4 environment. See > > lib/cctbx/cctbx_sources/ccp4io/lib/src/ccp4_general.c. > > > > > > If you look at the code you can see that $CINCL is determined at > > run-time. You are > > right that this environment var is not needed at compile time. Files > > like environ.def and > > default.def are read at this time. Perhaps there has been a > > corruption of one of these > > files or you are pointing to an earlier version of $CINCL. Does the > > error occur with > > refmac alone or with every CCP4 prog? > > > > > > Adam > > > > > > Dr Garib N Murshudov > Group Leader, MRC Laboratory of Molecular Biology > Hills Road > Cambridge > CB2 0QH UK > Email: [email protected] > Web http://www.mrc-lmb.cam.ac.uk > > > > > > > > > > > -- Edwin Pozharski, PhD, Assistant Professor University of Maryland, Baltimore ---------------------------------------------- When the Way is forgotten duty and justice appear; Then knowledge and wisdom are born along with hypocrisy. When harmonious relationships dissolve then respect and devotion arise; When a nation falls to chaos then loyalty and patriotism are born. ------------------------------ / Lao Tse /
