jacobian

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit ca3b3436b8c1bf263236ec124dc4f3565c803380
parent a1bbdd29dd15496e107ff0fb03870ab845be317a
Author: David Freifeld <freifeld.david@gmail.com>
Date:   Fri,  7 Aug 2020 14:22:34 -0700

Working on proper python install process

Diffstat:
M.github/workflows/ubuntu-latest.yml | 5+++--
MCMakeLists.txt | 15+++++++++------
Dmrbpnn/__init__.py | 4----
Msetup.py | 8+++-----
4 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml @@ -14,8 +14,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: install - run: sudo apt install libeigen3-dev - sudo apt install cmake + run: + sudo apt install libeigen3-dev && + sudo apt install cmake # python 3 -m pip install pytest # git clone https://github.com/pybind/pybind11.git # mkdir build diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.10.0) -#find_package(pybind11 CONFIG REQUIRED) -#include_directories(${pybind11_INCLUDE_DIRS}) + +set(CMAKE_CXX_COMPILER "g++") + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) set(COMPILE_FLAGS, "-w") @@ -20,15 +23,15 @@ if (!AVX) set(COMPILE_FLAGS "${COMPILE_FLAGS} -mavx -D AVX") endif (!AVX) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_FLAGS}") project (jacobian) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +find_package(pybind11 CONFIG REQUIRED) +include_directories(${pybind11_INCLUDE_DIRS}) #add_library(utils ./src/utils.cpp) #add_library(bpnn ./src/bpnn.cpp) -add_executable(jacobian example.cpp ./src/bpnn.cpp ./src/utils.cpp) +pybind11_add_module(jacobian example.cpp ./src/bpnn.cpp ./src/utils.cpp) #target_link_libraries(jacobian PUBLIC utils bpnn) enable_testing() diff --git a/mrbpnn/__init__.py b/mrbpnn/__init__.py @@ -1,4 +0,0 @@ -import os -from ctypes import CDLL -lib_path = os.path.join(os.path.dirname(__file__), 'mrbpnn.cpython-37m-darwin.so') -lib = CDLL(lib_path) diff --git a/setup.py b/setup.py @@ -8,19 +8,17 @@ from setuptools import setup, Distribution - class BinaryDistribution(Distribution): def has_ext_modules(foo): return True - setup( name='Jacobian', version='1.0', - description='Python Library for Neural Nets.', - packages=['mrbpnn'], + description='A library for neural networks.', + packages=['jacobian'], package_data={ - 'mrbpnn': ['mrbpnn.cpython-37m-darwin.so'], + 'jacobian': ['jacobian.cpython-37m-darwin.so'], }, distclass=BinaryDistribution )