Coder Social home page Coder Social logo

sravanikonda / intel-compilers-ci Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rscohn2/intel-compilers-ci

0.0 0.0 0.0 38 KB

Sample CI configurations for using intel compilers

License: Apache License 2.0

Dockerfile 31.35% Shell 35.41% CMake 24.33% C 5.01% Fortran 3.91%

intel-compilers-ci's Introduction

intel-compilers-ci

Scripts and sample configurations files for using intel compilers with cloud-based CI systems including Appveyor, CircleCI, GitLab, & TravisCI.

The script installs the Intel C++ & Fortran compilers on a minimal Container/VM, including the license file. The files in this repo can be used as a reference for non-interactive install of a compiler.

How it works

This repo contains:

  • a small shell script that downloads and installs Intel C++ & Fortran compilers for easy integration into CI scripts.
  • sample configuration files for popular CI systems
  • sample project to build

You can be up and running in 10 minutes! Setting up your project has 4 steps:

  1. Add the is-insallers directory to the top level of your project
  2. Add a few lines to your CI config file to install the compiler
  3. Obtain a license to use intel compilers
  4. Set some environment variables in the CI settings so the installer can get your license

If you want to try it out quickly, you can clone this repo and skip steps 1 & 2.

Add intel-compilers directory to your project

Clone this repo and copy the is-installers directory into your repo. If you don't want to include the files in your repo, just add this to your CI config to copy it at install time:

    wget https://github.com/rscohn2/intel-compilers-ci/archive/master.zip
    unzip master.zip
    mv intel-compilers-ci-master/is-installers .

Add a few lines to your CI config file to install the compiler

We have examples for several CI systems in this repo.

Obtain a license to use intel compilers

The compiler will check for a license when it is installed and everytime you compile a file. The license is a file in /opt/intel/licenses

If you do not already have a license for intel compilers, there are several options, some of which are low cost or free. Please look at Intel Parallel Studio XE. If you are looking at this repo, you are probably an open source developer. Open source contributors can qualify for a free license for Linux! Whatever option you choose, you can start immediately with a free 30 day license.

You will need your license file in the next step. You can download the license file by visiting Intel Registration Center. Click on the serial number in the leftmost column. Near the top of the page, there will be icons for downloading or emailing the license file. Treat the license file as a password. Do not put it in your publicly visible source repo or post it on the web.

Set some environment variables in the CI settings so the installer can get your license

When the CI system starts, we need to install the license file before installing the compiler. We do this by putting the contents of the license file in an environment variable, and then the install script writes the contents of the environment variable to a file.

Using an environment variable to hold the license file has 2 benefits.

  • Other people can fork your repo and use their own license by setting the environment variable to their license file.

  • CI systems do not let other users see your environment variables, so your license is secure

There is one catch. The license file has special characters that make it difficult to store in an environment variable. To avoid this problem, we encode the license file when storing it in a variable.

You can encode this way:

    openssl base64 -A < license.lic

Cut and paste the output of this command into an appropriate envrionment variable in the CI system.

All the CI systems let you set environment variables in the settings of the web interface. The settings are specific to your project on the CI system and not visible to other users. See CI systems for specific directions.

Below are the environment variable names:

    IS_LICENSE_DATA_LINUX
    IS_LICENSE_DATA_WINDOWS
    IS_LICENSE_DATA_MACOS_ICC
    IS_LICENSE_DATA_MACOS_IFORT

Sample project

We include a sample project based on Cmake to build with the C++ and Fortran compilers:

    # Build
    mkdir build
    cd build
    source /opt/intel/bin/iccvars.sh -arch intel64
    FC=ifort CC=icc CXX=icpc cmake ../src
    make
    # Test
    make test

Compiler versions

The master branch of this repo will install the latest compiler. We also have branches for each Compiler release, and GitHub releases for each branch.

CI systems

TravisCI

Status: Build Status

Setting the environment variable: Instructions

CircleCI

Status: CircleCI

Setting the environment variable: Instructions

Gitlab CI/CD

Status: Build Status

Setting the environment variable: instructions

Appveyor

Status: Build status

Setting the environment variable: instructions

Azure Pipelines

Status: Build Status

Setting the environment variable: instructions

Updating for a new compiler release

  • Update the installer URL and file names in the install script and the silent.cfg file.

  • Push a feature branch to verify that it works. Pull requests may not have access to the license files, depending on the CI system configuration.

  • Merge the feature branch

  • Make a branch for the compiler release

  • In the new branch, edit the README.md so the URL for the build badges use the branch name, instead of master.

  • Push a feature branch and verify that it works.

  • Merge the feature branch

intel-compilers-ci's People

Contributors

anoopmad avatar rscohn2 avatar sravanikonda avatar triskadecaepyon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.