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

provide option to deviate from compiler used to build perl #9

Open
oodler577 opened this issue Jun 16, 2021 · 4 comments
Open

provide option to deviate from compiler used to build perl #9

oodler577 opened this issue Jun 16, 2021 · 4 comments
Assignees

Comments

@oodler577
Copy link
Collaborator

oodler577 commented Jun 16, 2021

I'd like to be able to compile openmp stuff using a different compiler that the one used to build perl; specifically the case where perl is compiled with gcc and I want to compile Inline OpenMP with icc - and the other way around. I am certain this is feasible, just don't know atm how feasible.

Example,

use Inline (
    C  => 'DATA',
    with         => q{Alien::OpenMP},
    compiler => ICC,
);

my $oenv = OpenMP::Environment->new;

for my $i (qw/1 2 4 8 16 32 64 128/) {
    $oenv->omp_num_threads($i);
    test
}
__DATA__
__C__
#include <omp.h>
#include <stdio.h>
#include <p5-inline-openmp-utils.h>

void test(void) {
  #pragma omp parallel
  {
    if (0 == omp_get_thread_num())
      printf("'%d' should be '%d'\n", omp_get_num_threads(), num_threads); 
  }
}```
@zmughal
Copy link
Member

zmughal commented Nov 15, 2021

There is a hack used in the PDL CI workflow that gets ExtUtils::MakeMaker to use clang to build PDL's C code with a Linux perl that was built with gcc, so it is possible as long as certain config values can be changed:

https://github.com/PDLPorters/pdl/blob/2.061/.github/workflows/ci.yml#L67-L74

edit: already mentioned this previously at #6 (comment)

@oodler577
Copy link
Collaborator Author

I would like to do this, and it would be helpful on environments (e.g., HPC clusters) that use perl based on gcc but provide access to commercial compilers. So that one may specify with a perl build using gcc that they want to use a different suite of compilers for their OpenMP work (e.g., Intel, Portland Group, NAG, etc).

@oodler577
Copy link
Collaborator Author

oodler577 commented Dec 31, 2021

This should be the next capability, I'll start working on it. I happen to have access to various HPC environments and commercial compilers, and it'll give me a reason to actually use this module on them. And that might drive some additional ideas - which will hopefully lead to a real case for an Inline::C::OpenMP type module.

@oodler577 oodler577 self-assigned this Feb 25, 2022
@oodler577
Copy link
Collaborator Author

oodler577 commented May 11, 2022

picking this up, targeting some time before TPC

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

No branches or pull requests

2 participants