import os Import('env') module_env = env.Clone() module_env.pmlpp_build_tests = True if ARGUMENTS.get('pmlpp_build_tests', 'yes') == 'no': module_env.pmlpp_build_tests = 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 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)