LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-19-2020, 03:50 PM   #1
nbody2020
LQ Newbie
 
Registered: Jul 2020
Posts: 3

Rep: Reputation: Disabled
Unhappy Issue with gcc compiler flag '-DPIC'


Hi guys, I'm a relatively new Linux user on a Ubuntu machine. I've been trying to install a software called grackle and I've been having some trouble setting it up. Specifically, the issue seems to be that gcc doesn't recognize a compile flag '-DPIC' being entered by the Makefile. Here's the terminal output that I get:

Code:
libtool: compile:  gcc -c -DLINUX -DH5_USE_16_API -fPIC -DCONFIG_BFLOAT_8 -O2 -I/usr/include/hdf5/serial -I. auto_show_version.c  -fPIC -DPIC -o .libs/auto_show_version.o
libtool: compile:  gcc -c -DLINUX -DH5_USE_16_API -fPIC -DCONFIG_BFLOAT_8 -O2 -I/usr/include/hdf5/serial -I. auto_show_version.c -o auto_show_version.o >/dev/null 2>&1
libtool: link: /tmp/build/80754af9/libtool_1538243245774/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc -shared  -fPIC -DPIC  .libs/auto_show_config.o .libs/auto_show_flags.o .libs/auto_show_version.o .libs/calculate_cooling_time.o .libs/calculate_dust_temperature.o .libs/calculate_gamma.o .libs/calculate_pressure.o .libs/calculate_temperature.o .libs/calc_temp1d_cloudy_g.o .libs/calc_temp_cloudy_g.o .libs/calc_rates_g.o .libs/calc_tdust_1d_g.o .libs/calc_tdust_3d_g.o .libs/cie_thin_cooling_rate_g.o .libs/colh2diss_g.o .libs/coll_rates_g.o .libs/cool1d_cloudy_g.o .libs/cool1d_cloudy_old_tables_g.o .libs/cool1d_multi_g.o .libs/cool_multi_time_g.o .libs/initialize_chemistry_data.o .libs/initialize_cloudy_data.o .libs/initialize_UVbackground_data.o .libs/interpolators_g.o .libs/set_default_chemistry_parameters.o .libs/solve_chemistry.o .libs/solve_rate_cool_g.o .libs/update_UVbackground_rates.o   -L/usr/lib/x86_64-linux-gnu/ -lhdf5_serial -lz -lgfortran    -Wl,-soname -Wl,libgrackle-3.2.dev2.so -o .libs/libgrackle-3.2.dev2.so
/tmp/build/80754af9/libtool_1538243245774/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc: unrecognized option '-DPIC'
/tmp/build/80754af9/libtool_1538243245774/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc: use the --help option for usage information
Does anyone have any experience with errors like this? Thanks for the help!
 
Old 07-20-2020, 03:00 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 15,948

Rep: Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279
Hi and welcome here, at LQ.

-fPIC is a valid option. Otherwise need to know what OS, which compiler, which version of grackle and other important information. Dropping in an error message is not enough to help you. http://www.catb.org/~esr/faqs/smart-...html#beprecise
 
Old 07-20-2020, 03:59 AM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,850

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
check out this: https://grackle.readthedocs.io/en/gr...tallation.html
 
Old 07-20-2020, 01:37 PM   #4
nbody2020
LQ Newbie
 
Registered: Jul 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the responses. The link JJJCR posted is the one I've been using to perform the installation. There isn't really any documentation of bugs on that page, so I've had to turn to other resources.

In terms of further details about my system and the software itself, I'm using Ubuntu 20.04 as my distro and I'm working with the latest GitHub release of grackle, which is v3.1.1. Before posting here I wanted to get a better idea of what the '-DPIC' flag is and whether anyone else has had a similar issue using gcc. Google searches yielded no results and I couldn't find any references to the flag in the documentation for various versions of gcc. As pan64 said, -fPIC seems to be a valid option, as do other similar flags ending in 'PIC', but not -DPIC. Needless to say, I'm pretty confused.

I imagine the information I've just provided still isn't completely sufficient to get help. I haven't taken any diagnostic steps to isolate the problem because of how poorly I understand it. Let me know if there's any more information I can give to further clarify the issue. Thanks again!
 
Old 07-21-2020, 02:33 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 15,948

Rep: Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279
3 commands to check your config:
conda --version
conda info
conda list --show-channel-urls
 
Old 07-21-2020, 04:19 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,764

Rep: Reputation: Disabled
Quote:
Originally Posted by nbody2020 View Post
I wanted to get a better idea of what the '-DPIC' flag is
This is just the -D option to cpp (C preprocessor) that defines macro PIC with the value of 1. Basically, the same as #define PIC 1 in the code. It is inserted by libtool when generating flags for building a shared library.

This macro is rarely used, mostly in inline assembler code like this:
Code:
#ifdef PIC
#define PIC_PROLOGUE \
   pushl %ebx; \
   call  1f;   \
1:       \
   popl  %ebx; \
   addl  $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
#define PIC_EPILOGUE \
   popl  %ebx
#define PIC_PLT(x)   x@PLT
#define PIC_GOT(x)   x@GOT(%ebx)
#define PIC_GOTOFF(x)   x@GOTOFF(%ebx)
#else
[...]
 
Old 07-21-2020, 04:29 AM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 15,948

Rep: Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279Reputation: 5279
this is the error message: x86_64-conda_cos6-linux-gnu-cc: unrecognized option '-DPIC' we need to handle.
the question why this compiler does not accept -D?
As I see newer libtool implementations use both -fPIC and -DPIC. Probably this x86_64-conda_cos6-linux-gnu-cc is just too old, but I can only guess....
 
Old 07-21-2020, 06:48 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 5,183
Blog Entries: 14

Rep: Reputation: 2996Reputation: 2996Reputation: 2996Reputation: 2996Reputation: 2996Reputation: 2996Reputation: 2996Reputation: 2996Reputation: 2996Reputation: 2996Reputation: 2996
istr that LFS builds always had both -fPIC and -DPIC when building libraries. It never caused me any problems.
 
Old 07-21-2020, 05:23 PM   #9
nbody2020
LQ Newbie
 
Registered: Jul 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for all the replies! the conda --version command tells me I'm running version 4.8.2. It seems that the latest version may be 4.8.3, but as I understand it Grackle is not a particularly new piece of code, so I would think that 4.8.2 should be up-to-date enough. It appears that I'm working with version 2.4.6 of libtool, which also seems to be relatively up to date.

Here are some terminal dumps from conda info and conda list --show-channel-urls if those could be of any help.

I feel like I should mention that I've previously had issues with x86_64-conda_cos6-linux-gnu-cc. During an initial attempt at building Grackle on my machine I got an error saying that libtool was looking for x86_64-conda_cos6-linux-gnu-cc in a non-existent subdirectory of my /tmp/ folder. I was instructed by other Grackle users to create this subdirectory and put a soft link to x86_64-conda_cos6-linux-gnu-cc in it to resolve the issue, which worked but now I'm getting the current issue. Not sure if this information carries any weight but I thought it might be good to mention since pan64 brought up that file.

It's starting to sound like the issue could be either anaconda related (perhaps x86_64-conda_cos6-linux-gnu-cc) or something with libtool. Thanks again for all the help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Gparted - to "flag" or NOT to "flag" as "raid" ? helen314 Linux - Newbie 3 06-28-2019 04:02 PM
Help Required adding flag on packet and routing packet based on flag over ssl tunnel. sskhan Linux - Networking 1 02-02-2018 04:56 PM
i have ubuntu 16.04 and gcc 5.1.3 default compiler but i need want gcc 4.4 compiler srinivas_k Linux - Newbie 4 07-06-2016 11:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration