mirror of
https://github.com/Relintai/pmlpp.git
synced 2024-12-22 15:06:47 +01:00
136 lines
4.4 KiB
Plaintext
136 lines
4.4 KiB
Plaintext
import os
|
|
|
|
Import('env')
|
|
|
|
module_env = env.Clone()
|
|
|
|
module_env.pmlpp_build_old_classes = False
|
|
module_env.pmlpp_build_tests = True
|
|
|
|
if ARGUMENTS.get('pmlpp_build_old_classes', 'yes') == 'no':
|
|
module_env.pmlpp_build_old_classes = False
|
|
|
|
if ARGUMENTS.get('pmlpp_build_tests', 'yes') == 'no':
|
|
module_env.pmlpp_build_tests = False
|
|
|
|
if env.msvc:
|
|
# Old classes can't build on MSVC
|
|
module_env.pmlpp_build_old_classes = False
|
|
|
|
sources = [
|
|
"register_types.cpp",
|
|
|
|
"mlpp/lin_alg/mlpp_vector.cpp",
|
|
"mlpp/lin_alg/mlpp_matrix.cpp",
|
|
"mlpp/lin_alg/mlpp_tensor3.cpp",
|
|
|
|
"mlpp/activation/activation.cpp",
|
|
"mlpp/ann/ann.cpp",
|
|
"mlpp/auto_encoder/auto_encoder.cpp",
|
|
"mlpp/bernoulli_nb/bernoulli_nb.cpp",
|
|
"mlpp/c_log_log_reg/c_log_log_reg.cpp",
|
|
"mlpp/convolutions/convolutions.cpp",
|
|
"mlpp/cost/cost.cpp",
|
|
"mlpp/data/data.cpp",
|
|
"mlpp/dual_svc/dual_svc.cpp",
|
|
"mlpp/exp_reg/exp_reg.cpp",
|
|
"mlpp/gan/gan.cpp",
|
|
"mlpp/gaussian_nb/gaussian_nb.cpp",
|
|
"mlpp/gauss_markov_checker/gauss_markov_checker.cpp",
|
|
"mlpp/hidden_layer/hidden_layer.cpp",
|
|
"mlpp/hypothesis_testing/hypothesis_testing.cpp",
|
|
"mlpp/kmeans/kmeans.cpp",
|
|
"mlpp/knn/knn.cpp",
|
|
"mlpp/lin_alg/lin_alg.cpp",
|
|
"mlpp/lin_reg/lin_reg.cpp",
|
|
"mlpp/log_reg/log_reg.cpp",
|
|
"mlpp/mann/mann.cpp",
|
|
"mlpp/mlp/mlp.cpp",
|
|
"mlpp/multinomial_nb/multinomial_nb.cpp",
|
|
"mlpp/multi_output_layer/multi_output_layer.cpp",
|
|
"mlpp/numerical_analysis/numerical_analysis.cpp",
|
|
"mlpp/outlier_finder/outlier_finder.cpp",
|
|
"mlpp/output_layer/output_layer.cpp",
|
|
"mlpp/pca/pca.cpp",
|
|
"mlpp/probit_reg/probit_reg.cpp",
|
|
"mlpp/regularization/reg.cpp",
|
|
"mlpp/softmax_net/softmax_net.cpp",
|
|
"mlpp/softmax_reg/softmax_reg.cpp",
|
|
"mlpp/stat/stat.cpp",
|
|
"mlpp/svc/svc.cpp",
|
|
"mlpp/tanh_reg/tanh_reg.cpp",
|
|
"mlpp/transforms/transforms.cpp",
|
|
"mlpp/uni_lin_reg/uni_lin_reg.cpp",
|
|
"mlpp/utilities/utilities.cpp",
|
|
"mlpp/wgan/wgan.cpp",
|
|
]
|
|
|
|
if module_env.pmlpp_build_tests:
|
|
module_env.Prepend(CPPDEFINES=["TESTS_ENABLED"])
|
|
|
|
sources += [
|
|
"test/mlpp_tests.cpp",
|
|
"test/mlpp_matrix_tests.cpp",
|
|
]
|
|
|
|
if module_env.pmlpp_build_old_classes:
|
|
module_env.Prepend(CPPDEFINES=["OLD_CLASSES_ENABLED"])
|
|
|
|
sources += [
|
|
"mlpp/wgan/wgan_old.cpp",
|
|
"mlpp/output_layer/output_layer_old.cpp",
|
|
"mlpp/multi_output_layer/multi_output_layer_old.cpp",
|
|
"mlpp/hidden_layer/hidden_layer_old.cpp",
|
|
"mlpp/mlp/mlp_old.cpp",
|
|
"mlpp/pca/pca_old.cpp",
|
|
"mlpp/uni_lin_reg/uni_lin_reg_old.cpp",
|
|
"mlpp/outlier_finder/outlier_finder_old.cpp",
|
|
"mlpp/probit_reg/probit_reg_old.cpp",
|
|
"mlpp/svc/svc_old.cpp",
|
|
"mlpp/softmax_reg/softmax_reg_old.cpp",
|
|
"mlpp/auto_encoder/auto_encoder_old.cpp",
|
|
"mlpp/tanh_reg/tanh_reg_old.cpp",
|
|
"mlpp/softmax_net/softmax_net_old.cpp",
|
|
"mlpp/multinomial_nb/multinomial_nb_old.cpp",
|
|
"mlpp/mann/mann_old.cpp",
|
|
"mlpp/log_reg/log_reg_old.cpp",
|
|
"mlpp/lin_reg/lin_reg_old.cpp",
|
|
"mlpp/gaussian_nb/gaussian_nb_old.cpp",
|
|
"mlpp/gan/gan_old.cpp",
|
|
"mlpp/exp_reg/exp_reg_old.cpp",
|
|
"mlpp/dual_svc/dual_svc_old.cpp",
|
|
"mlpp/c_log_log_reg/c_log_log_reg_old.cpp",
|
|
"mlpp/bernoulli_nb/bernoulli_nb_old.cpp",
|
|
"mlpp/ann/ann_old.cpp",
|
|
"mlpp/numerical_analysis/numerical_analysis_old.cpp",
|
|
"mlpp/regularization/reg_old.cpp",
|
|
"mlpp/gauss_markov_checker/gauss_markov_checker_old.cpp",
|
|
"mlpp/utilities/utilities_old.cpp",
|
|
"mlpp/transforms/transforms_old.cpp",
|
|
"mlpp/stat/stat_old.cpp",
|
|
"mlpp/lin_alg/lin_alg_old.cpp",
|
|
"mlpp/hypothesis_testing/hypothesis_testing_old.cpp",
|
|
"mlpp/data/data_old.cpp",
|
|
"mlpp/cost/cost_old.cpp",
|
|
"mlpp/convolutions/convolutions_old.cpp",
|
|
"mlpp/activation/activation_old.cpp",
|
|
]
|
|
|
|
if module_env.pmlpp_build_tests and module_env.pmlpp_build_old_classes:
|
|
sources += [
|
|
"test/mlpp_tests_old.cpp",
|
|
]
|
|
|
|
|
|
if ARGUMENTS.get('pmlpp_shared', 'no') == 'yes':
|
|
# Shared lib compilation
|
|
module_env.Append(CCFLAGS=['-fPIC'])
|
|
module_env['LIBS'] = []
|
|
shared_lib = module_env.SharedLibrary(target='#bin/pmlpp', source=sources)
|
|
shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0]
|
|
env.Append(LIBS=[shared_lib_shim])
|
|
env.Append(LIBPATH=['#bin'])
|
|
else:
|
|
# Static compilation
|
|
module_env.add_source_files(env.modules_sources, sources)
|