Не удается создать проект «Быстрая искусственная нейронная сеть» (FANN). Он дает неопределенные ссылки при использовании определенного кода

У меня возникли проблемы с библиотекой быстрой искусственной нейронной сети (FANN). Я не могу заставить его работать в моей системе. Я думаю, что мне не хватает какой-то зависимости, но я не могу понять, как это исправить.

Я нахожусь на Ubuntu, но я решил клонировать репозиторий из GitHub, а не использовать apt-get. Я клонировал в каталог /home/lucas/includes/fann и из этого каталога я выполнил cmake ., и наконец sudo make install как описано в readme GitHub.

Некоторые части библиотеки работают, но некоторые вылетают. Вот мой пример файла:

#include <iostream>
#include <fann.h>
#include <fann_cpp.h>

using namespace std;
using namespace FANN;

int main(int argc, char** argv) {
fann_type** input_data;
//training_data training_data;
return 0;
}

Вот мой файл CMake:

cmake_minimum_required(VERSION 2.8.4)
project(FANN_sin)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

include_directories(/usr/local/include/)
include_directories(/usr/local/lib/)

set(SOURCE_FILES main.cpp)
add_executable(FANN_sin ${SOURCE_FILES})

target_link_libraries(FANN_sin /usr/local/lib/libfann.a)

Когда я запускаю код с training_data training_data закомментировано, компилируется и запускается. Тем не менее, когда я пытаюсь запустить с этой частью без комментариев, проект не будет.

Вот ошибки:

/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_batch_parallel._omp_fn.1':
floatfann.c:(.text+0x20): undefined reference to `omp_get_num_threads'
floatfann.c:(.text+0x28): undefined reference to `omp_get_thread_num'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_irpropm_parallel._omp_fn.3':
floatfann.c:(.text+0x116): undefined reference to `omp_get_num_threads'
floatfann.c:(.text+0x11e): undefined reference to `omp_get_thread_num'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_quickprop_parallel._omp_fn.5':
floatfann.c:(.text+0x304): undefined reference to `omp_get_num_threads'
floatfann.c:(.text+0x30c): undefined reference to `omp_get_thread_num'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_sarprop_parallel._omp_fn.7':
floatfann.c:(.text+0x592): undefined reference to `omp_get_num_threads'
floatfann.c:(.text+0x59a): undefined reference to `omp_get_thread_num'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_batch_parallel._omp_fn.0':
floatfann.c:(.text+0xf375): undefined reference to `omp_get_num_threads'
floatfann.c:(.text+0xf37d): undefined reference to `omp_get_thread_num'
floatfann.c:(.text+0xf3dd): undefined reference to `GOMP_barrier'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_irpropm_parallel._omp_fn.2':
floatfann.c:(.text+0xf4c5): undefined reference to `omp_get_num_threads'
floatfann.c:(.text+0xf4cd): undefined reference to `omp_get_thread_num'
floatfann.c:(.text+0xf52d): undefined reference to `GOMP_barrier'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_quickprop_parallel._omp_fn.4':
floatfann.c:(.text+0xf615): undefined reference to `omp_get_num_threads'
floatfann.c:(.text+0xf61d): undefined reference to `omp_get_thread_num'
floatfann.c:(.text+0xf67d): undefined reference to `GOMP_barrier'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_sarprop_parallel._omp_fn.6':
floatfann.c:(.text+0xf765): undefined reference to `omp_get_num_threads'
floatfann.c:(.text+0xf76d): undefined reference to `omp_get_thread_num'
floatfann.c:(.text+0xf7cd): undefined reference to `GOMP_barrier'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_batch_parallel':
floatfann.c:(.text+0x13a9a): undefined reference to `omp_set_dynamic'
floatfann.c:(.text+0x13aa1): undefined reference to `omp_set_num_threads'
floatfann.c:(.text+0x13ac5): undefined reference to `GOMP_parallel_start'
floatfann.c:(.text+0x13ad4): undefined reference to `GOMP_parallel_end'
floatfann.c:(.text+0x13b09): undefined reference to `omp_set_dynamic'
floatfann.c:(.text+0x13b10): undefined reference to `omp_set_num_threads'
floatfann.c:(.text+0x13b48): undefined reference to `GOMP_parallel_start'
floatfann.c:(.text+0x13b57): undefined reference to `GOMP_parallel_end'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_irpropm_parallel':
floatfann.c:(.text+0x13e6d): undefined reference to `omp_set_dynamic'
floatfann.c:(.text+0x13e74): undefined reference to `omp_set_num_threads'
floatfann.c:(.text+0x13e98): undefined reference to `GOMP_parallel_start'
floatfann.c:(.text+0x13ea7): undefined reference to `GOMP_parallel_end'
floatfann.c:(.text+0x13f09): undefined reference to `omp_set_dynamic'
floatfann.c:(.text+0x13f10): undefined reference to `omp_set_num_threads'
floatfann.c:(.text+0x13f79): undefined reference to `GOMP_parallel_start'
floatfann.c:(.text+0x13f88): undefined reference to `GOMP_parallel_end'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_quickprop_parallel':
floatfann.c:(.text+0x142ad): undefined reference to `omp_set_dynamic'
floatfann.c:(.text+0x142b4): undefined reference to `omp_set_num_threads'
floatfann.c:(.text+0x142d8): undefined reference to `GOMP_parallel_start'
floatfann.c:(.text+0x142e7): undefined reference to `GOMP_parallel_end'
floatfann.c:(.text+0x14355): undefined reference to `omp_set_dynamic'
floatfann.c:(.text+0x1435c): undefined reference to `omp_set_num_threads'
floatfann.c:(.text+0x143dd): undefined reference to `GOMP_parallel_start'
floatfann.c:(.text+0x143ec): undefined reference to `GOMP_parallel_end'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_sarprop_parallel':
floatfann.c:(.text+0x1470d): undefined reference to `omp_set_dynamic'
floatfann.c:(.text+0x14714): undefined reference to `omp_set_num_threads'
floatfann.c:(.text+0x14738): undefined reference to `GOMP_parallel_start'
floatfann.c:(.text+0x14747): undefined reference to `GOMP_parallel_end'
floatfann.c:(.text+0x1483d): undefined reference to `omp_set_dynamic'
floatfann.c:(.text+0x14844): undefined reference to `omp_set_num_threads'
floatfann.c:(.text+0x1492a): undefined reference to `GOMP_parallel_start'
floatfann.c:(.text+0x14939): undefined reference to `GOMP_parallel_end'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_batch_parallel._omp_fn.0':
floatfann.c:(.text+0xf4a4): undefined reference to `GOMP_barrier'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_irpropm_parallel._omp_fn.2':
floatfann.c:(.text+0xf5f4): undefined reference to `GOMP_barrier'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_quickprop_parallel._omp_fn.4':
floatfann.c:(.text+0xf744): undefined reference to `GOMP_barrier'
/usr/local/lib/libfann.a(floatfann.c.o): In function `fann_train_epoch_sarprop_parallel._omp_fn.6':
floatfann.c:(.text+0xf894): undefined reference to `GOMP_barrier'
collect2: error: ld returned 1 exit status
make[2]: *** [FANN_sin] Error 1
make[1]: *** [CMakeFiles/FANN_sin.dir/all] Error 2
make: *** [all] Error 2

Я исследовал ошибки и предполагаю, что они ссылаются на GOMP, реализацию OpenMP для GCC. В настоящее время у меня GCC версии 4.8.4. У меня также есть пакет библиотеки поддержки libgomp1 из apt-get, поэтому я не уверен, в чем проблема.

Я что-то пропустил? Благодарю.

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector