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

Change cmake config to use gcc #76

Closed
wants to merge 20 commits into from

Conversation

volpatto
Copy link
Member

This PR changes the C and C++ compilers to use gcc family instead clang as required in #70.

Remarks:

  • I changed the code generation in hookman/hookman_generator.py, please see lines 592-598 there.

  • Instead installing clang-dev from conda-forge, now compilers is required (as we need both C and C++ compilers).

  • One of the tests is failing. The error is related to pytest-datadir and file regression. I have no previous experiences with this plugin and I have been facing some struggle with it. I need some help in this regard.

Thanks in advance.

@@ -6,8 +6,8 @@ set(PROJECT_NAME hookman)
set(ARTIFACTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/artifacts)

if(NOT WIN32)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_C_COMPILER cc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if these 4 lines are removed, and we leave the defaults? (If the result is the same, it's better to remove the lines)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try it. You mean, remove the whole if?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

environment.devenv.yml Outdated Show resolved Hide resolved
@@ -589,13 +589,13 @@ def _plugin_cmake_file_content(self, plugin_id):
set(ARTIFACTS_DIR ${{CMAKE_CURRENT_SOURCE_DIR}}/artifacts)

if(NOT WIN32)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_C_COMPILER cc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these two lines be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try.

@tadeu
Copy link
Member

tadeu commented Oct 14, 2019

Is the fail also on master? I'll ask @williamjamir to take a look on this, then

@williamjamir
Copy link
Contributor

First of all, thanks for to take a look on this issue =)

To solve the issue, you need to re-run the test (locally) with the --force-regen parameter ;)

@williamjamir
Copy link
Contributor

Is the fail also on master? I'll ask @williamjamir to take a look on this, then

Currently, only appveyor on python 3.7 is failing.

I'm hoping to fix this issue by migrating the CI to Github actions ;)

Copy link
Contributor

@arthursoprana arthursoprana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at the comments

build/HookManConfig.cmake Outdated Show resolved Hide resolved
environment.devenv.yml Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 14, 2019

Codecov Report

Merging #76 into master will decrease coverage by 1.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
- Coverage   99.57%   98.52%   -1.06%     
==========================================
  Files           7        7              
  Lines         474      474              
==========================================
- Hits          472      467       -5     
- Misses          2        7       +5

.travis.yml Show resolved Hide resolved
@volpatto
Copy link
Member Author

First of all, thanks for to take a look on this issue =)

To solve the issue, you need to re-run the test (locally) with the --force-regen parameter ;)

Thanks, @williamjamir! Now all tests are passing!!

Comment on lines 20 to 24
- compilers
- gxx_impl_linux-64
- gcc_impl_linux-64
- gxx_linux-64
- gcc_linux-64
Copy link
Member Author

@volpatto volpatto Oct 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tadeu @arthursoprana I need some help here, please. The thing is: conda env breaks if we use compilers only. Then I took a look at eden and included here a similar stack for C/Cpp. However, in Travis, the compilers are gathered from the system instead of the env. Please take a look at the snippet below:

-- The CXX compiler identification is GNU 5.4.0
-- The C compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works

Is this OK? What do you recommend?

Copy link
Member

@tadeu tadeu Oct 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it should use the compiler from the environment. Probably the line set(CMAKE_CXX_COMPILER c++) (etc.) is messing up, it's trying to find c++ instead of what conda defines in the CXX env var (and the CC env var).

The GCC version should be 7.3.0 (this 5.4.0 is from some compiler installed in the CI system)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will try to seek a way to fix this problem

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tadeu fixed. The thing is: the CI test is performed within an env created by tox. However, conda_deps inside tox.ini doesn't include C/C++ compilers according to conda. So, inside tox env, there is no compiler, therefore the compilers will be gathered from system. I had to change tox.ini to include a minimal set of compilers for C and C++. I'm aware about compilers from conda, they are intend to be used for builds, but I think that we are OK using such package for tests with tox here.

tox.ini Outdated
Comment on lines 20 to 27
conda-forge::gcc_linux-64==7.3.0
conda-forge::gcc_impl_linux-64==7.3.0
conda-forge::gxx_linux-64==7.3.0
conda-forge::gxx_impl_linux-64==7.3.0
libgcc-ng==7.3.0
libstdcxx-ng==7.3.0
binutils_linux-64==2.31.1
binutils_impl_linux-64==2.31.1
Copy link
Member Author

@volpatto volpatto Oct 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks a lot for the help! Don't you think that would be interesting if we use >= to keep track of updates in the compilers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's see first if this works first, its just a guess :)
If it works, we change to >=

@tadeu
Copy link
Member

tadeu commented Oct 17, 2019

Meh, it didn't work, it's probably because of tox, it probably is installing the conda packages but isn't "activating" them, so environment variables such as CXX and CC won't be defined.

Maybe we should change to use conda devenv and invoke, instead of tox? What do you think @nicoddemus and @williamjamir?

@nicoddemus
Copy link
Member

Meh, it didn't work, it's probably because of tox, it probably is installing the conda packages but isn't "activating" them, so environment variables such as CXX and CC won't be defined.

That can be checked by adding a echo $CXX as the first line in commands.

Maybe we should change to use conda devenv and invoke, instead of tox? What do you think @nicoddemus and @williamjamir?

I'm fine with it. 👍

@tadeu
Copy link
Member

tadeu commented Oct 17, 2019

Ok, but I think that changing from tox go beyond from what @volpatto was trying to do here. @volpatto, perhaps, for now, you can try tp just update Travis configuration so that it uses a newer GCC (>= 7.3.0 instead of 5.4.0), and drop these compilers from tox (since they aren't being used anyway)

@volpatto
Copy link
Member Author

volpatto commented Oct 21, 2019

Ok, but I think that changing from tox go beyond from what @volpatto was trying to do here. @volpatto, perhaps, for now, you can try tp just update Travis configuration so that it uses a newer GCC (>= 7.3.0 instead of 5.4.0), and drop these compilers from tox (since they aren't being used anyway)

Nice, then. Maybe we can use the "compiler set for build" (compilers and gxx_linux things) from conda, since this way hookman's build is actually using the recent compilers from conda env. I don't see it as a solution, since the intention of those packages are to supply compiler resources for package buildings (AFAIK). But it can be a fix for now.

What do you think, @tadeu @nicoddemus @arthursoprana @williamjamir? Or it would be better to forget it and just set it in Travis (just as @tadeu said)?

@volpatto
Copy link
Member Author

Ok, but I think that changing from tox go beyond from what @volpatto was trying to do here. @volpatto, perhaps, for now, you can try tp just update Travis configuration so that it uses a newer GCC (>= 7.3.0 instead of 5.4.0), and drop these compilers from tox (since they aren't being used anyway)

Nice, then. Maybe we can use the "compiler set for build" (compilers and gxx_linux things) from conda, since this way hookman's build is actually using the recent compilers from conda env. I don't see it as a solution, since the intention of those packages are to supply compiler resources for package buildings (AFAIK). But it can be a fix for now.

What do you think, @tadeu @nicoddemus @arthursoprana @williamjamir? Or it would be better to forget it and just set it in Travis (just as @tadeu said)?

Builds OK, except for appveyor, but this is expected (and we hope that it will be fixed when we move to GH Actions). Please note that the compilers are properly used from tox env with the current tox.ini.

@volpatto
Copy link
Member Author

A kind ping here, since @tadeu approved recently this PR and I don't know what to do at the moment.

Cheers!

Copy link
Contributor

@arthursoprana arthursoprana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if this is passing you may merge it ;)

But appveyor is failing...

@williamjamir
Copy link
Contributor

The appVeyor is broken with the following message:

Solving environment: ...working... failed
PackagesNotFoundError: The following packages are not available from current channels:
  - conda-forge::gcc_impl_linux-64==7.3.0
  - conda-forge::gxx_impl_linux-64==7.3.0
  - conda-forge::gxx_linux-64==7.3.0
  - conda-forge::gcc_linux-64==7.3.0
Current channels:

@volpatto
Copy link
Member Author

volpatto commented Jun 5, 2020

As soon as I have some time, I'll come back here.

Perhaps the channel name conda-forge is not appropriated. Is hookman using ESSS mirrors?

Comment on lines +20 to +23
- conda-forge::gcc_linux-64==7.3.0
- conda-forge::gcc_impl_linux-64==7.3.0
- conda-forge::gxx_linux-64==7.3.0
- conda-forge::gxx_impl_linux-64==7.3.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These packages cannot be found at the moment. Further investigation is required.

@volpatto
Copy link
Member Author

volpatto commented Jun 5, 2020

As soon as I have some time, I'll come back here.

Perhaps the channel name conda-forge is not appropriated. Is hookman using ESSS mirrors?

Dumb question... it's a publicly available ESSS package. So I should check compiler-related package versions.

@nicoddemus
Copy link
Member

Is this still relevant or can we close this?

@volpatto
Copy link
Member Author

volpatto commented Sep 5, 2022

Is this still relevant or can we close this?

I think this is a really old PR, and don't even know if this is still worthy. IMHO, we can decline it, @nicoddemus. If we need something as we have in this PR, it is easy to redo.

@nicoddemus
Copy link
Member

nicoddemus commented Sep 5, 2022

Can you delete it then please @volpatto ?

Ask Bender:

!delete-branch change-cmake-config-to-use-gcc

@nicoddemus
Copy link
Member

Actually I just realized you probably only created this branch in this repository right? Then just close it here please. 👍

@volpatto volpatto closed this Sep 5, 2022
@volpatto volpatto deleted the change-cmake-config-to-use-gcc branch September 5, 2022 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants