Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mpc] CFLAGS CXXFLAGS env be ignore #913

Open
congzhangzh opened this issue May 26, 2019 · 7 comments
Open

[mpc] CFLAGS CXXFLAGS env be ignore #913

congzhangzh opened this issue May 26, 2019 · 7 comments

Comments

@congzhangzh
Copy link

I try to compile ace under conda envirement which will automate set many env like CFLAGS CXXFLAGS, but mpc ignore it which cause error.

How to make mpc append to these environment variable but not replace??

Tks,
Cong

@jwillemsen
Copy link
Member

In your build script can't you assign CFLAGS/CXXFLAGS to a different environment variable which you add in your platform_macros.GNU file to CFLAGS/CXXFLAGS as used by the make files?

@congzhangzh
Copy link
Author

Hi,

Something like :

export CONDA_CFLAGS="$CFLAGS"
echo "echo CFLAGS+= $CONDA_FLAGS" >> $(ACE_ROOT)/include/makeinclude/platform_macros.GNU ?

Why mpc does not append it's flags to environment one but create from ground?

For your ref, My super build script,

export ACE_ROOT=~/projects/ACE_TAO/ACE

cd $ACE_ROOT

echo '#include "ace/config-linux.h"' > ace/config.h

echo 'xerces3=1' > $(ACE_ROOT)/bin/MakeProjectCreator/config/default.features
echo 'ssl=1' >> $(ACE_ROOT)/bin/MakeProjectCreator/config/default.features
echo 'versioned_namespace=1' >> $(ACE_ROOT)/bin/MakeProjectCreator/config/default.features

platform_file=include/makeinclude/platform_linux.GNU
echo 'xerces3=1' > $(ACE_ROOT)/include/makeinclude/platform_macros.GNU
echo 'ssl=1' >> $(ACE_ROOT)/include/makeinclude/platform_macros.GNU
echo "$(cat $platform_file)" >> $(ACE_ROOT)/include/makeinclude/platform_macros.GNU

bin/mwc.pl -type gnuace ACE.mwc --workers $(( $(nproc) +2 ))

make -j $(( $(nproc) +2 ))

Tks,
Cong

@congzhangzh
Copy link
Author

Do this process need to be done for all flags like LDFLAGS?as mpc do some detect and variable set from ground?

As in https://conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html

Tks,
Cong

@congzhangzh
Copy link
Author

@jwillemsen

@jwillemsen
Copy link
Member

See http://www.dre.vanderbilt.edu/~schmidt/commercial-support.html for the commercial support providers when you want to have guaranteed help, my free time is very limited

@iguessthislldo
Copy link
Member

Why mpc does not append it's flags to environment one but create from ground?

While I could imagine environments like Conda setting these variables, I don't think it's normal to do so.

As in https://conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html

This says $CFLAGS, etc. is only passed on macOS, and even then it's just the -arch flag. I've never used Conda, are there other things being passed? Could you give us an example of what these variables are getting set to in your case?

@congzhangzh
Copy link
Author

@iguessthislldo as conda bundle compiler itself,to build by conda , it's better to use conda version to achieve binary compitibility.

https://www.anaconda.com/utilizing-the-new-compilers-in-anaconda-distribution-5/

https://conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html

Even for make, it will first detect and set these variable, and then use laterly. If it's already exist, it will be use directly or be append. But mpc directly override them or part of them

Ref: a conda build c++ project

https://github.com/conda-forge/flatbuffers-feedstock/blob/master/recipe/build.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants