diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml index cd2cad6f24fcf72139d736e5ac6547f490c2dcfd..302a700bee70ea8bda432260afcfcdcd02f97537 100644 --- a/.gitlab/ci/build.gitlab-ci.yml +++ b/.gitlab/ci/build.gitlab-ci.yml @@ -28,6 +28,114 @@ build:ubuntu_cpp: - build_cpp/ - install_cpp/ +build:ubuntu_cpp_g++10: + stage: build + needs: [] + tags: + - docker + + script: + # Download dependencies + # aidge_core + - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:ubuntu_cpp"' + - unzip -o build_artifacts.zip -d . + - rm -rf build_cpp + # aidge_backend_cpu + - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5140/jobs/artifacts/master/download?job=build:ubuntu_cpp"' + - unzip -o build_artifacts.zip -d . + - rm -rf build_cpp + + # Build current module + - export CMAKE_PREFIX_PATH=../install_cpp + - apt install -y g++-10 + - mkdir -p build_cpp + - mkdir -p install_cpp + - cd build_cpp + - export CXX=/usr/bin/g++-10 + - cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON -DCOVERAGE=ON .. + - make -j4 all install + +build:ubuntu_cpp_g++12: + stage: build + needs: [] + tags: + - docker + + script: + # Download dependencies + # aidge_core + - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:ubuntu_cpp"' + - unzip -o build_artifacts.zip -d . + - rm -rf build_cpp + # aidge_backend_cpu + - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5140/jobs/artifacts/master/download?job=build:ubuntu_cpp"' + - unzip -o build_artifacts.zip -d . + - rm -rf build_cpp + + # Build current module + - export CMAKE_PREFIX_PATH=../install_cpp + - apt install -y g++-12 + - mkdir -p build_cpp + - mkdir -p install_cpp + - cd build_cpp + - export CXX=/usr/bin/g++-12 + - cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON -DCOVERAGE=ON .. + - make -j4 all install + +build:ubuntu_cpp_clang12: + stage: build + needs: [] + tags: + - docker + + script: + # Download dependencies + # aidge_core + - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:ubuntu_cpp"' + - unzip -o build_artifacts.zip -d . + - rm -rf build_cpp + # aidge_backend_cpu + - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5140/jobs/artifacts/master/download?job=build:ubuntu_cpp"' + - unzip -o build_artifacts.zip -d . + - rm -rf build_cpp + + # Build current module + - export CMAKE_PREFIX_PATH=../install_cpp + - apt install -y clang-12 + - mkdir -p build_cpp + - mkdir -p install_cpp + - cd build_cpp + - export CXX=/usr/bin/clang++-12 + - cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON -DCOVERAGE=ON .. + - make -j4 all install + +build:ubuntu_cpp_clang15: + stage: build + needs: [] + tags: + - docker + + script: + # Download dependencies + # aidge_core + - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:ubuntu_cpp"' + - unzip -o build_artifacts.zip -d . + - rm -rf build_cpp + # aidge_backend_cpu + - 'curl --location --output build_artifacts.zip "https://gitlab.eclipse.org/api/v4/projects/5140/jobs/artifacts/master/download?job=build:ubuntu_cpp"' + - unzip -o build_artifacts.zip -d . + - rm -rf build_cpp + + # Build current module + - export CMAKE_PREFIX_PATH=../install_cpp + - apt install -y clang-15 + - mkdir -p build_cpp + - mkdir -p install_cpp + - cd build_cpp + - export CXX=/usr/bin/clang++-15 + - cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON -DCOVERAGE=ON .. + - make -j4 all install + build:ubuntu_python: stage: build needs: [] @@ -100,3 +208,47 @@ build:ubuntu_python: # paths: # - build_cpp/ # - install_cpp/ + +# build:windows_python: +# stage: build +# needs: [] +# tags: +# - windows + +# image: buildtools +# before_script: +# # Install Chocolatey +# - Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) +# # Install dependencies +# - choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=System"' -Y +# - choco install git -Y +# - choco install python -Y +# - choco install cuda -Y +# # Update PATH +# - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") +# script: +# # Download dependencies +# # aidge_core (CPP) +# - 'curl "https://gitlab.eclipse.org/api/v4/projects/5139/jobs/artifacts/main/download?job=build:windows_cpp" -o build_artifacts.zip' +# - Expand-Archive -Path .\build_artifacts.zip -DestinationPath . -Force +# - Remove-Item .\build_cpp\ -Recurse +# # aidge_backend_cpu (CPP) +# - 'curl "https://gitlab.eclipse.org/api/v4/projects/5140/jobs/artifacts/master/download?job=build:windows_cpp" -o build_artifacts.zip' +# - Expand-Archive -Path .\build_artifacts.zip -DestinationPath . -Force +# - Remove-Item .\build_cpp\ -Recurse +# # aidge_backend_cpu (Python) +# - 'curl "https://gitlab.eclipse.org/api/v4/projects/5140/jobs/artifacts/master/download?job=build:windows_python" -o build_artifacts.zip' +# - Expand-Archive -Path .\build_artifacts.zip -DestinationPath . -Force + +# - python -m pip install virtualenv +# - virtualenv venv +# - venv\Scripts\Activate.ps1 +# # Numpy dependancy for unit test +# - python -m pip install numpy +# - $env:AIDGE_INSTALL = "$pwd" + "install" +# - $env:CMAKE_PREFIX_PATH = "../install_cpp" +# - python -m pip install . +# artifacts: +# expire_in: 1 week +# paths: +# - venv/ diff --git a/setup.py b/setup.py index 0b0f66e9132d66cdb6385d7f8c6c69ae0cc5d0e3..e84cbd7c657de48d4a486dc2842edc1ff7aa9de2 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,8 @@ class CMakeBuild(build_ext): self.spawn(['cmake', str(cwd), param_py, '-DTEST=OFF', f'-DCMAKE_INSTALL_PREFIX:PATH={install_path}']) if not self.dry_run: - self.spawn(['make', 'all', 'install', '-j', max_jobs]) + self.spawn(['cmake', '--build', '.', '--config', 'Debug', '-j', max_jobs]) + self.spawn(['cmake', '--install', '.', '--config', 'Debug']) os.chdir(str(cwd)) aidge_package = build_lib / (get_project_name()) @@ -81,7 +82,7 @@ class CMakeBuild(build_ext): # Copy all shared object files from build_temp/lib to aidge_package for root, _, files in os.walk(build_temp.absolute()): for file in files: - if file.endswith('.so') and (root != str(aidge_package.absolute())): + if (file.endswith('.so') or file.endswith('.pyd')) and (root != str(aidge_package.absolute())): currentFile=os.path.join(root, file) shutil.copy(currentFile, str(aidge_package.absolute())) @@ -100,7 +101,6 @@ if __name__ == '__main__': long_description_content_type="text/markdown", long_description="\n".join(DOCLINES[2:]), classifiers=[c for c in CLASSIFIERS.split('\n') if c], - platforms=["Linux"], packages=find_packages(where="."), include_package_data=True, ext_modules=[CMakeExtension(get_project_name())],