[Developers] Developers Digest, Vol 37, Issue 7

Matthew Supernaw matthew.supernaw at noaa.gov
Tue Mar 20 15:14:42 PDT 2012


All,

Now that Dave mentions the minor errors he found while compiling with
clang, I recall fixing them. Clang is much more strict and will reject
incorrect code that other compilers may allow. Clang does not have
anything like the "-fpermissive" flag that gcc has(kind of a drag).
I'll be happy to modify and commit sometime tomorrow, however at the
moment I can only test for mac and bsd os, perhaps a windows and linux
user can test after I commit.
Thanks.

Matthew

On Tue, Mar 20, 2012 at 3:00 PM,  <developers-request at admb-project.org> wrote:
> Send Developers mailing list submissions to
>        developers at admb-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.admb-project.org/mailman/listinfo/developers
> or, via email, send a message with subject or body 'help' to
>        developers-request at admb-project.org
>
> You can reach the person managing the list at
>        developers-owner at admb-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Developers digest..."
>
>
> Today's Topics:
>
>   1. Re: compiling ADMB with clang (Teresa A'mar)
>   2. Re: compiling ADMB with clang (dave fournier)
>   3. Re: compiling ADMB with clang (dave fournier)
>   4. Re: Developers Digest, Vol 37, Issue 6 (Matthew Supernaw)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 19 Mar 2012 12:12:05 -0700
> From: Teresa A'mar <zta at uw.edu>
> To: dave fournier <davef at otter-rsch.com>
> Cc: developers at admb-project.org
> Subject: Re: [Developers] compiling ADMB with clang
> Message-ID: <4F678505.8030303 at uw.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Dave,
>
> I tried compiling ADMB with clang 2.9 on Linux 32-bit.  There were some
> issues with 2.9, so I used 3.0 instead.  I have a separate ADMB
> configure file as well as a src/clang.mak file.
>
> Which OS are you using?  You can download the clang/llvm binaries here
> http://llvm.org/releases/download.html, although I don't see any MinGW
> binaries for 3.0.
>
> -Teresa
>
>>
>> I tried to compile ADMB with clang.  After a few files the make crashed
>> with the message
>>
>>        fatal error: 'fstream' file not found
>>
>>
>> There appear to be header file problems.  Has anyone successfully used
>> clang to compile ADMB?
>>
>> clang -v outputs
>>
>> clang version 2.8 (branches/release_28)
>> Target: x86_64-pc-linux-gnu
>> Thread model: posix
>>
>>
>>
>>              Dave
>>
>>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 19 Mar 2012 13:30:45 -0700
> From: dave fournier <davef at otter-rsch.com>
> To: Teresa A'mar <zta at uw.edu>
> Cc: developers at admb-project.org
> Subject: Re: [Developers] compiling ADMB with clang
> Message-ID: <4F679775.1010704 at otter-rsch.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 12-03-19 12:12 PM, Teresa A'mar wrote:
>
> Hi Teresa,
>
> I am working on some version of Ubuntu.
>
> Issues so far are:
>
> 1.) version of clang supplied with Ubuntu does not work.
>
> 2.) download latest version ofclang via svn and run configure on it
>
> 3.) configure sees the broken version of clang and want to use it to
> build the new clang.
> so get rid of clang.  Clang now builds.
>
> 4.)  clang does not like  class scope inside class definition as in
>
>      class xxx
>      {
>           xxx:xxx(void);    //  should be just  xxx(void);
>      };
>
> so fix a bunch of those
>
>   5.) Problem in  cifstream need to cast int to ios::mode or some such
> thing.
>
> 6.)  problem with hard wired  ar in make files.  so create symbolic link
> from
>
>    llvm-ar  to my ~/bin/ar
>
> 7.) some kind of problem with the  ar line anyway so
>       change to relevant directory and do
>
>             ar rs libxxx.a *.obj
>
>     by hand to buid all the ADMB libs one by one
>
> That is as far as I got so far.
>
>         Dave
>
>
>
>
>
>
>
>
>
>> Hi Dave,
>>
>> I tried compiling ADMB with clang 2.9 on Linux 32-bit.  There were
>> some issues with 2.9, so I used 3.0 instead.  I have a separate ADMB
>> configure file as well as a src/clang.mak file.
>>
>> Which OS are you using?  You can download the clang/llvm binaries here
>> http://llvm.org/releases/download.html, although I don't see any MinGW
>> binaries for 3.0.
>>
>> -Teresa
>>
>>>
>>> I tried to compile ADMB with clang.  After a few files the make crashed
>>> with the message
>>>
>>>        fatal error: 'fstream' file not found
>>>
>>>
>>> There appear to be header file problems.  Has anyone successfully used
>>> clang to compile ADMB?
>>>
>>> clang -v outputs
>>>
>>> clang version 2.8 (branches/release_28)
>>> Target: x86_64-pc-linux-gnu
>>> Thread model: posix
>>>
>>>
>>>
>>>              Dave
>>>
>>>
>>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 19 Mar 2012 14:49:30 -0700
> From: dave fournier <davef at otter-rsch.com>
> To: Teresa A'mar <zta at uw.edu>
> Cc: developers at admb-project.org
> Subject: Re: [Developers] compiling ADMB with clang
> Message-ID: <4F67A9EA.2030705 at otter-rsch.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 12-03-19 01:30 PM, dave fournier wrote:
>> On 12-03-19 12:12 PM, Teresa A'mar wrote:
>
> I had that confused. It seems that for compiled programs (not JIT ) one
> should use
> the linux archiver ar. the clang++ shell then used the linux ld.
>
> All now works. Question is are there better debugging tools than for gcc?
>
>        Dave
>
>
>
>
>
>
>
>
>>
>> Hi Teresa,
>>
>> I am working on some version of Ubuntu.
>>
>> Issues so far are:
>>
>> 1.) version of clang supplied with Ubuntu does not work.
>>
>> 2.) download latest version ofclang via svn and run configure on it
>>
>> 3.) configure sees the broken version of clang and want to use it to
>> build the new clang.
>> so get rid of clang.  Clang now builds.
>>
>> 4.)  clang does not like  class scope inside class definition as in
>>
>>      class xxx
>>      {
>>           xxx:xxx(void);    //  should be just  xxx(void);
>>      };
>>
>> so fix a bunch of those
>>
>>   5.) Problem in  cifstream need to cast int to ios::mode or some such
>> thing.
>>
>> 6.)  problem with hard wired  ar in make files.  so create symbolic
>> link from
>>
>>    llvm-ar  to my ~/bin/ar
>>
>> 7.) some kind of problem with the  ar line anyway so
>>       change to relevant directory and do
>>
>>             ar rs libxxx.a *.obj
>>
>>     by hand to buid all the ADMB libs one by one
>>
>> That is as far as I got so far.
>>
>>         Dave
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> Hi Dave,
>>>
>>> I tried compiling ADMB with clang 2.9 on Linux 32-bit.  There were
>>> some issues with 2.9, so I used 3.0 instead.  I have a separate ADMB
>>> configure file as well as a src/clang.mak file.
>>>
>>> Which OS are you using?  You can download the clang/llvm binaries
>>> here http://llvm.org/releases/download.html, although I don't see any
>>> MinGW binaries for 3.0.
>>>
>>> -Teresa
>>>
>>>>
>>>> I tried to compile ADMB with clang.  After a few files the make crashed
>>>> with the message
>>>>
>>>>        fatal error: 'fstream' file not found
>>>>
>>>>
>>>> There appear to be header file problems.  Has anyone successfully used
>>>> clang to compile ADMB?
>>>>
>>>> clang -v outputs
>>>>
>>>> clang version 2.8 (branches/release_28)
>>>> Target: x86_64-pc-linux-gnu
>>>> Thread model: posix
>>>>
>>>>
>>>>
>>>>              Dave
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> Developers mailing list
>> Developers at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/developers
>>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 20 Mar 2012 09:02:24 -0400
> From: Matthew Supernaw <matthew.supernaw at noaa.gov>
> To: developers at admb-project.org
> Subject: Re: [Developers] Developers Digest, Vol 37, Issue 6
> Message-ID:
>        <CAFfs6wTWLKzWtziP9mYWO1ee8kdQRApPARaLz9en8nJ-adZ3ug at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dave,
>
> I have successfully compiled admb with clang 3.0 on Mac OS 10.5. You error
> message would suggest that clang cannot find the stdc++ lib. Try the
> following flags with clang:
>
> "-DUSE_LAPLACE  -I../df1b2-separable -I../nh99 -I../linad99 -I../tools99
> -D__SPDLL__ -D__GNUDOS__ -Dlinux"
>
> I believe the "-D__GNUDOS__ -Dlinux" are what is required for the posix
> thread model. If you are interested in a more detailed static analysis, use
> "--analyze" in addition to the above. You should be able to compile with
> the same make procedure as gcc. Let me know if you have anymore problems.
>
>
> Matthew
> matthew.supernaw at noaa.gov
>
> On Mon, Mar 19, 2012 at 3:00 PM, <developers-request at admb-project.org>wrote:
>
>> Send Developers mailing list submissions to
>>        developers at admb-project.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>        http://lists.admb-project.org/mailman/listinfo/developers
>> or, via email, send a message with subject or body 'help' to
>>        developers-request at admb-project.org
>>
>> You can reach the person managing the list at
>>        developers-owner at admb-project.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Developers digest..."
>>
>>
>> Today's Topics:
>>
>>   1. compiling ADMB with clang (dave fournier)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Sun, 18 Mar 2012 15:26:03 -0700
>> From: dave fournier <davef at otter-rsch.com>
>> To: "'developers at admb-project.org'" <developers at admb-project.org>
>> Subject: [Developers] compiling ADMB with clang
>> Message-ID: <4F6660FB.6080303 at otter-rsch.com>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> I tried to compile ADMB with clang.  After a few files the make crashed
>> with the message
>>
>>      fatal error: 'fstream' file not found
>>
>>
>> There appear to be header file problems.  Has anyone successfully used
>> clang to compile ADMB?
>>
>> clang -v outputs
>>
>> clang version 2.8 (branches/release_28)
>> Target: x86_64-pc-linux-gnu
>> Thread model: posix
>>
>>
>>
>>            Dave
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> Developers mailing list
>> Developers at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/developers
>>
>>
>> End of Developers Digest, Vol 37, Issue 6
>> *****************************************
>>
>
>
>
> --
> Matthew Supernaw
> Scientific Programmer
> *National Oceanic and Atmospheric Administration*
> National Marine Fisheries Service
> Sustainable Fisheries Division
> St. Petersburg, FL, 33701
> Phone 727-551-5606
> Fax 727-824-5300
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.admb-project.org/pipermail/developers/attachments/20120320/93e3b574/attachment-0001.html>
>
> ------------------------------
>
> _______________________________________________
> Developers mailing list
> Developers at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/developers
>
>
> End of Developers Digest, Vol 37, Issue 7
> *****************************************



-- 
Matthew Supernaw
Scientific Programmer
National Oceanic and Atmospheric Administration
National Marine Fisheries Service
Sustainable Fisheries Division
St. Petersburg, FL, 33701
Phone 727-551-5606
Fax 727-824-5300


More information about the Developers mailing list