E
E
eagle2016-03-30 15:09:59
Java
eagle, 2016-03-30 15:09:59

How to connect a library from github to a project in Intellij Idea?

Hello!
You need to link the library to the Intellij Idea project.
Libraries from ready-made jar files are connected normally, but this one does not work.
I connect according to the instructions:

  1. I clone the project from git to the /project/lib folder
  2. I run cmake . in the terminal in the right folder
  3. I run sudo make install

At the moment, no error messages.
Then in the environment I go File -> Projects Structure -> Libraries
I add a new library, I specify the / project / lib / fann folder (maybe there is an error, you need to specify a specific file, I tried some, but there is no result).
The system does not recognize what type of files are in the folder, it offers its own options, I choose Classes / Native Library Location.
I save.
I run the file:
import com.googlecode.fannj.*;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class Solution {
    public static void main(String[] args) {
        //Для сборки новой ИНС необходимо создасть список слоев
        List<Layer> layerList = new ArrayList<Layer>();
        layerList.add(Layer.create(3, ActivationFunction.FANN_SIGMOID_SYMMETRIC, 0.01f));
        layerList.add(Layer.create(16, ActivationFunction.FANN_SIGMOID_SYMMETRIC, 0.01f));
        layerList.add(Layer.create(4, ActivationFunction.FANN_SIGMOID_SYMMETRIC, 0.01f));
        Fann fann = new Fann(layerList);
        //Создаем тренера и определяем алгоритм обучения
        Trainer trainer = new Trainer(fann);
        trainer.setTrainingAlgorithm(TrainingAlgorithm.FANN_TRAIN_RPROP);
        /* Проведем обучение взяв уроки из файла, с максимальным колличеством
           циклов 100000, показывая отчет каждую 100ю итерацию и добиваемся
        ошибки меньше 0.0001 */
        trainer.train(new File("assets/lesson.txt").getAbsolutePath(), 100000, 100, 0.0001f);
        fann.save("ann");
    }
}

And an error occurs:
java.lang.UnsatisfiedLinkError: Unable to load library 'fann': Native library

What can be done about it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question