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 the code of setup to this #95

Open
itstalmeez opened this issue Nov 26, 2023 · 0 comments
Open

Change the code of setup to this #95

itstalmeez opened this issue Nov 26, 2023 · 0 comments

Comments

@itstalmeez
Copy link

import numpy as np
import os
from distutils.core import setup
from distutils.extension import Extension

Check for NumPy

try:
import numpy as np
except ImportError:
raise Exception('NumPy does not appear to be installed. Install before proceeding ... ')

Check and print OpenCV path

try:
import cv2
path = [line.split()[-1] for line in cv2.getBuildInformation().splitlines() if 'Install to:' in line][0]
print('OpenCV path:', path)
except ImportError:
raise Exception('OpenCV does not appear to be installed. Install before proceeding ... ')

extensions = [
Extension(
name="autoRIFT.autoriftcore",
sources=['geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp'],
include_dirs=[np.get_include(), 'geo_autoRIFT/autoRIFT/include', os.path.join(path, 'include/opencv4/')],
library_dirs=[os.path.join(path, 'lib')],
libraries=['opencv_core', 'opencv_imgproc'],
extra_compile_args=['-std=c++11'],
language="c++"
),
Extension(
name="geogrid.geogridOptical",
sources=['geo_autoRIFT/geogrid/bindings/geogridOpticalmodule.cpp', 'geo_autoRIFT/geogrid/src/geogridOptical.cpp'],
include_dirs=[np.get_include(), 'geo_autoRIFT/geogrid/include', os.path.join(path, 'include')],
library_dirs=[os.path.join(path, 'lib')],
libraries=['gomp', 'gdal'],
extra_compile_args=['-std=c++11'],
language="c++"
)
]

setup(
name='geo_autoRIFT',
version='1.5.0',
description='This is the autoRIFT python package',
package_dir={'autoRIFT': 'geo_autoRIFT/autoRIFT', 'geogrid': 'geo_autoRIFT/geogrid'},
packages=['autoRIFT', 'geogrid'],
ext_modules=extensions
)

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

1 participant