Hi all,
Thanks to everybody who has contributed over the past couple of days on the various bulletin boards I have posted to. As is always the case, the solution was quite simple but completely passed me by. I'm going to use Mac inexperience as an excuse here... :-)
So the original problem was not being able to compile a working executable of CNS v1.21 from source on Mac OSX 10.6.3. The reason for compiling from source is because in order to run CNS from Aria 2.3, a program used in NMR automated peak assignment and structure calculation, CNS needs to be recompiled with Aria-specific source code. With fink-installed gfortran/gcc 4.5 compilers, CNS compiles and links with no warnings or errors, but fails at the execution stage. With fink-installed 4.4, CNS compiles successfully but when executed produces a simple "segmentation fault" message.
The problem here is the fink-installed compilers. Harry Powell and Daniel O'Donovan have guided me to the light - the High Performance Computing for Mac OS X webpage (http://hpc.sourceforge.net) has binaries for the gcc 4.5 compiler package, which installs in /usr/local/. Compilation with this compiler set produces a working CNS executable. The only other modification is to copy the Makefile.header.2.gfortran file from cns_solve_1.21/instlib/machine/supported/intel-x86_64bit-linux to cns_solve_1.21/instlib/machine/supported/intel-x86_64bit-linux. Compile with 'make install compiler=gfortran', making sure that /usr/local/path is in $PATH.
With the Intel 11.1 compilers (and I used the evaluation version here), CNS compiles successfully, but fails on execution. Thanks to Axel Brunger and Benjamin Bardiaux, for sharing that the Intel fortran compiler is not compatible with Xcode 3.2.2, although it does not seem to break gfortran in this case. A little more information can be found here:
http://software.intel.com/en-us/articles/intel-fortran-for-mac-os-x-incompatible-with-xcode-322/
Thanks goes to Benjamin Bardiaux for the link. The webpage suggests two fixes. One is to add the '-use-asm' option to both the compilation and linker lines. This seems to work, and produces a working CNS executable. Not until now did I consider Xcode to be the problem, and at no point over the past few days did I come across or register the intel webpage linked above during my hours of google-trawling.
The other option is to reinstall Xcode 3.2.1, which I assume is the version Axel Brunger said he reinstalled. This can be downloaded from the Mac Development Centre. Then reinstall the Intel fortran compiler. I have not tried this option, since the first option seems to have worked quite well.
Thanks once again,
Pryank
On 7 Jun 2010, at 14:47, Pryank Patel wrote:
>
> Hi All,
> Just a quick update: Using fink, I have now installed the gcc45 compiler
> package (the latest version), and recompiled cns. Initially, it seemed
> to work - it successfully compiled and completed the linking stage.
> However, when I try to execute cns, either with './cns' or by running
> one of the test scripts, I get the following:
>
> dmemory error code = ******
> %ALLHP error encountered: fatal coding error
> (CNS is in mode: SET ABORT=NORMal END)
> *****************************************************
> ABORT mode will terminate program execution.
> *****************************************************
> Program will stop immediately.
> ============================================================
> Maximum dynamic memory allocation: 0 bytes
> Maximum dynamic memory overhead: 8 bytes
> Program started at: on
> Program stopped at: 14:32:05 on 07-Jun-2010
> CPU time used: 0.0036 seconds
> ============================================================
>
> Perhaps I was a bit hasty in going to gcc45, I probably should have
> tried gcc43 or gcc44 first.
>
> Any suggestions? I'm thinking it's just a matter of modifying the
> compiler/linker options.
>
> Best wishes,
> Pryank
>
>
>
> On 07/06/10 09:15, Patel, Pryank wrote:
>> Hi Dan,
>> Yes, it is a 64-bit Intel Core 2 duo.
>>
>> I did try gfortran. At the bottom of my first email, I listed the errors that I had. It seems to fail at the linking stage (these were with the undefined symbols to _csatty_, etc). Perhaps I'm just missing some linking options?
>>
>> I also sent the queries to the Aria and CNS lists, so some people may be receiving my query three times...
>>
>> Pryank
>>
>>
>> On 6 Jun 2010, at 22:58, Daniel O'Donovan wrote:
>>
>>
>>> Hi Pryank,
>>>
>>> When I get to the lab tomorrow I'll have a crack at compiling all this and let you know my results. Two things that stand out;
>>>
>>> First - 64 bit vs 32 bit is probably quite important here. As I take it, you're compiling on a new Mac - and so I expect that it's 64 bit (ie a Core 2 duo rather than a Core duo - like my old MacBook). Is that so?
>>>
>>> Secondly - have you tried gfortran rather than g77? g77 is now legacy and not very well supported, a lot of my FORTRAN pain has derived from g77! gfortran is usually a simple drop-in replacement and available through fink. If you're not using fink then this website comes with recommendations: http://hpc.sourceforge.net/
>>>
>>> I'm afraid I can't make much of the errors from here, but people on the CNS or ARIA lists might be of more use to you (CCPN Analysis provides more of a 'front end' interface into ARIA rather than bothering with the intricacies of installing it).
>>>
>>> Hoping that helps,
>>>
>>> Dan
>>>
>>>
>>> On 6 Jun 2010, at 21:55, Patel, Pryank wrote:
>>>
>>>
>>>> Hi All,
>>>> As a follow-up, I forgot to mention in my previous email message on this subject that I have also attempted to compile cns_solve 1.21, with aria 2.3 sources, with the evaluation version of ifort and icc, and seems to compile ok. But when I run the generated executable, the following error message appears:
>>>>
>>>> forrtl: severe (174): SIGSEGV, segmentation fault occurred
>>>> Image PC Routine Line Source
>>>> cns 000000010029C7BE _xtarmoin_ 1813 xdeclare.f
>>>> cns 000000010029C68E _xreres_ 764 xdeclare.f
>>>> cns 000000010003E04A _MAIN__ 167 cns.f
>>>> cns 000000010000184C Unknown Unknown Unknown
>>>> cns 00000001000017E4 Unknown Unknown Unknown
>>>>
>>>> I did make sure I ran the command 'limit stacksize unlimited' as well.
>>>>
>>>> Apologies for not including that in my original email.
>>>>
>>>> Best wishes,
>>>> Pryank
>>>>
>>>>
>>>> On 6 Jun 2010, at 19:52, Patel, Pryank wrote:
>>>>
>>>>
>>>>> Hi All,
>>>>> Firstly, sincere apologies if this question has been asked and answered before, but I am looking for some clarification. I have recently acquired a Mac, and was hoping to be able to run Aria 2.3 with CNS 1.21 and CCPN Analysis projects for NMR structure calculation, and I'm wondering if this is at all possible.
>>>>>
>>>>> First of all, I am unable to compile cns v1.21 source using gcc 4.2.1 (g77 compiler)- there are various errors, including:
>>>>>
>>>>> compiling: angledb.f
>>>>> /var/folders/ZR/ZR2UPrAaGUOKd1MtnwJ7xU+++TI/-Tmp-//ccX0UDSm.s:11277:FATAL:Symbol L_angledbinit_$stub already defined.
>>>>> make[3]: *** [angledb.o] Error 1
>>>>>
>>>>> and:
>>>>>
>>>>> xscale.f: In subroutine `xsclsq2':
>>>>> xscale.f:850:
>>>>> & MAXSET,TGSET,HPSFSET,TYPESF,ERROR,
>>>>> 1
>>>>> xscale.f:868: (continued):
>>>>> DOUBLE COMPLEX ARG(maxset)
>>>>> 2
>>>>> Invalid declaration of or reference to symbol `maxset' at (2) [initially seen at (1)]
>>>>> xscale.f:850:
>>>>> & MAXSET,TGSET,HPSFSET,TYPESF,ERROR,
>>>>> 1
>>>>> xscale.f:874: (continued):
>>>>>
>>>>> etc etc, resulting in:
>>>>>
>>>>> compiling: xyzparse.f
>>>>>
>>>>> compiling: dmemory.c
>>>>>
>>>>> compiling: machine_c.c
>>>>> make[3]: Target `../bin/cns_solve' not remade because of errors.
>>>>> make[2]: *** [cns_solve] Error 2
>>>>> make[1]: *** [cns_solve] Error 2
>>>>>
>>>>> As I understand it, it is difficult to compile CNS under Mac OSX, which is why I have the CNS Mac binary installed. However, I also understand that the Mac CNS binary cannot be used with Aria since the specific Aria routines (eg: the vean statements) are not running under Mac OSX with Intel (according to the aria installation notes), presumably because the Aria fortran sources are not part of the CNS binary(?). This also shows up when trying to running Aria with the CNS binary, with the following error messages:
>>>>>
>>>>> CNSsolve> vean class vea1 force $k_bor_1 $k_cen_1 end
>>>>> %CNSsolve-ERR: unrecognized command:
>>>>> vean
>>>>> ^^^^
>>>>> %CNSsolve-ERR: unrecognized command:
>>>>> vean class
>>>>> ^^^^^
>>>>> %CNSsolve-ERR: unrecognized command:
>>>>> vean class vea1
>>>>> ^^^^
>>>>>
>>>>> etc etc, and I obviously cannot re-compile the CNS executable because of the above compilation errors (and others).
>>>>>
>>>>> I then tried compilation using gfortran instead of g77, since I compiled successfully under linux with gfortran, albeit with some modifications. The fortran sources seemed to compile successfully without errors, but then fails at the linking stage:
>>>>>
>>>>> compiling: xyzparse.f
>>>>>
>>>>> compiling: dmemory.c
>>>>>
>>>>> compiling: machine_c.c
>>>>>
>>>>> linking: cns_solve
>>>>>
>>>>> Undefined symbols:
>>>>> "_csatty_", referenced from:
>>>>> _vchktt_ in machine_f.o
>>>>> "_outbuf_", referenced from:
>>>>> _vopen_ in machine_f.o
>>>>> "_cnscalloc_", referenced from:
>>>>> _chkalloc_ in heap.o
>>>>> "_cnsqalloc_", referenced from:
>>>>> _qryalloc_ in heap.o
>>>>> "_cns0alloc_", referenced from:
>>>>> _inithp_ in heap.o
>>>>> "_cnsqptrsz_", referenced from:
>>>>> _cnsheader_ in cns.o
>>>>> "_cnsialloc_", referenced from:
>>>>> _chkalloc_ in heap.o
>>>>> ld: symbol(s) not found
>>>>> collect2: ld returned 1 exit status
>>>>>
>>>>> I have also read somewhere (although I don't know if this is true for the current version) that Aria on Mac cannot do torsional angle dynamics, and that modifications to sa_ltad_hightemp4.cns and sa_ltad_cool1.cns are required, changing tcoupling=true to vscaling=true (see http://daffy.uah.edu/nmr/private/AnalysisMods.html).
>>>>>
>>>>> So, I guess I'm looking for some answers to the following:
>>>>> 1) Can CNS be compiled using g77/gfortran/gcc on Mac OSX 10.6.3? If so, can anyone advise on how to do this?
>>>>> 2) If CNS cannot be compiled on Mac OSX, can I run Aria as I would like? If so, how?
>>>>>
>>>>> Many thanks in advance for any help/suggestions.
>>>>>
>>>>> Best wishes,
>>>>> Pryank
>>>>>
>>>>>
>>>>>
>>>>
>>> Daniel O'Donovan
>>> [log in to unmask]
>>>
>>
> <pryank.vcf>
|