RE: Building with GCC on Ubuntu 18

From: Vermaas, Joshua (Joshua.Vermaas_at_nrel.gov)
Date: Mon Nov 12 2018 - 11:34:11 CST

Ok, looking back at it, I solved this problem for myself by appending a directory to include in .bashrc:

export INCLUDE=/usr/include/tcl8.5

This *will* make gcc look in the right place for a tcl.h. :)

-Josh

On 2018-11-12 08:14:26-07:00 Jrme Hnin wrote:

Yup, that's my experience. Josh, do you have symlinked directories somewhere that you didn't mention? ;-)

On Mon, 12 Nov 2018 at 16:08, Jim Phillips <jim_at_ks.uiuc.edu<mailto:jim_at_ks.uiuc.edu>> wrote:

Sorry, actually the config script magic just checks for a tcl[-threaded]
directory in namd/ and $HOME. It's up to the compiler to find system
libraries or you can specify the directory manually with --tcl-prefix

Jim

On Mon, 12 Nov 2018, Jrme Hnin wrote:

> The magic is not working for me... GCC says it can't find tcl.h.
>
>> I don't change anything in arch/ other than CUDA locations
> Here I'm trying a non-CUDA build, changing precisely nothing from the git
> repo.
>
> Jerome
>
> On Fri, 9 Nov 2018 at 23:21, Jim Phillips <jim_at_ks.uiuc.edu<mailto:jim_at_ks.uiuc.edu>> wrote:
>
>>
>> The config script is magic like that. -Jim
>>
>> On Fri, 9 Nov 2018, Vermaas, Joshua wrote:
>>
>>> Hi Jerome,
>>>
>>> Weird. When I build NAMD with 18.04, gnu compilers looks in the system
>> directories by default, so I don't change anything in arch/ other than CUDA
>> locations when I rebuild NAMD with a new release.
>>>
>>> -Josh
>>>
>>>
>>> On 2018-11-09 06:01:10-07:00 Jrme Hnin wrote:
>>>
>>> Thanks Josh!
>>> That said, in my tests the system library locations are not searched, as
>> the default line in the arch file is:
>>> TCLDIR=/Projects/namd2/tcl/tcl8.5.9-linux-x86_64-threaded
>>> Jerome
>>>
>>> On Thu, 8 Nov 2018 at 18:51, Vermaas, Joshua <Joshua.Vermaas_at_nrel.gov<mailto:Joshua.Vermaas_at_nrel.gov>
>> <mailto:Joshua.Vermaas_at_nrel.gov<mailto:Joshua.Vermaas_at_nrel.gov>>> wrote:
>>> The other option is to use dynamically loaded fftw and tcl. On ubuntu, I
>> think the relevant packages are "fftw-dev" or "libfftw3-dev" and either
>> "tcl8.5-dev" or "tcl8.6-dev", which put things where the default Makefile
>> expects to find them.
>>>
>>> -Josh
>>>
>>>
>>>
>>> On 2018-11-08 10:29:37-07:00 owner-namd-l_at_ks.uiuc.edu<mailto:owner-namd-l_at_ks.uiuc.edu><mailto:
>> owner-namd-l_at_ks.uiuc.edu<mailto:owner-namd-l_at_ks.uiuc.edu>> wrote:
>>>
>>> Well look into it. Thanks for reporting that, Jerome.
>>> Julio
>>>
>>> On Nov 8, 2018, at 11:18 AM, Jrme Hnin <jerome.henin_at_ibpc.fr<mailto:jerome.henin_at_ibpc.fr><mailto:
>> jerome.henin_at_ibpc.fr<mailto:jerome.henin_at_ibpc.fr>>> wrote:
>>>
>>> Dear all,
>>> just an announcement to anyone who'd run into trouble building NAMD with
>> GCC as shipped with recent Ubuntu distros. They enable PIE by default:
>> https://wiki.ubuntu.com/SecurityTeam/PIEC636776324665459509&sdata=qofrySaPCIP7RQyrL4R2jlOycD8H%2BINEA6Ys%2Bfh5GzA%3D&reserved=0><
>>
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__wiki.ubuntu.com_SecurityTeam_PIE%26d%3DDwMFaQ%26c%3DOCIEmEwdEq_aNlsP4fF3gFqSN-E3mlr2t9JcDdfOZag%26r%3DjUfnSyKkfkyVRBIUzlG1GSGGZAZGcznwr8YliSSCjPc%26m%3DfvL2HxXBc0Wm9o6bm9n18giKJj9NVVjzK9Hhr5h9tCg%26s%3DZIZpjLxaNPamXi49qEfd3tYsc1VcVChfhldG_UD1W1s%26e%3D&data=02%7C01%7CJoshua.Vermaas%40nrel.gov%7Cc432f9193ff14a45f2bd08d6464369c2%7Ca0f29d7e28cd4f5484427885aee7c080%7C0%7C0%7C636773652699132132&sdata=UwzoxQ4JOA1qDf7Rrx2L%2BX%2BCUONJ9BvbNq%2FR038X17Y%3D&reserved=0<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__wiki.ubuntu.com_SecurityTeam_PIE%26d%3DDwMFaQ%26c%3DOCIEmEwdEq_aNlsP4fF3gFqSN-E3mlr2t9JcDdfOZag%26r%3DjUfnSyKkfkyVRBIUzlG1GSGGZAZGcznwr8YliSSCjPc%26m%3DfvL2HxXBc0Wm9o6bm9n18giKJj9NVVjzK9Hhr5h9tCg%26s%3DZIZpjLxaNPamXi49qEfd3tYsc1VcVChfhldG_UD1W1s%26e%3D&data=02%7C01%7CJoshua.Vermaas%40nrel.gov%7C259d9af20bf74ffedddb08d648b187a9%7Ca0f29d7e28cd4f5484427885aee7c080%7C0%7C0%7C636776324665469518&sdata=u2uuYnvqYMEK4QYc7vsEc1p%2BzZ9g2XPFonxh3InHzCs%3D&reserved=0>
>>>
>>> which will break if you try to link NAMD with, say, a static FFTW that
>> wasn't built with that option. Then you'll see errors like this:
>>>> relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
>> making a PIE object; recompile with -fPIC
>>> This can be fixed by adding the option -no-pie to CXXOPTS in the
>> relevant arch file (eg. Linux-x86_64-g++.arch).
>>>
>>> Jerome
>>>
>

This archive was generated by hypermail 2.1.6 : Wed Sep 18 2019 - 23:20:29 CDT