Hi ChMaster,
erst einmal vielen Dank für Deine schnelle Antwort.
Ich habe das so eingepflegt, wie Du mir geschrieben hast, erhalte jetzt auch keine Fehlermeldung mehr das er was nicht findet, dafür aber noch jede Menge undefined reference Fehler.
Ich poste einfach mal den Code, den ich zusammen kopiert habe (Anhand eines Beispiels aus der Intel MKL). Das Beispiel ist zwar C-Code, sollte aber doch meines Wissens in c++ genau so ausgeführt werden?!
Code: Alles auswählen
#include <QtCore/QCoreApplication>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "mkl_dfti.h"
#include "mkl_dfti_examples.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
mkl_double_complex* x_in;
mkl_double_complex* x_exp;
DFTI_DESCRIPTOR_HANDLE hand = 0;
MKL_LONG n;
MKL_LONG Status;
double Scale;
double maxerr;
double eps = DOUBLE_EPS;
int failure = 0;
/*
** Read input data from input file
** n - size of transform
*/
if (read_data_file_1d(argc, argv, &n)) {
qDebug(" TEST FAILED : Read input data from input file\n");
return 1;
}
if (LEGEND_PRINT) {
qDebug("\n\n COMPLEX_1D_DOUBLE_EX1\n");
qDebug(" Forward-Backward 1D complex transform for double precision data\n\n");
qDebug(" Configuration parameters:\n\n");
qDebug(" DFTI_FORWARD_DOMAIN = DFTI_COMPLEX\n");
qDebug(" DFTI_PRECISION = DFTI_DOUBLE\n");
qDebug(" DFTI_DIMENSION = 1\n");
qDebug(" DFTI_LENGTHS = %d\n", n);
qDebug(" DFTI_PLACEMENT = DFTI_INPLACE\n");
qDebug(" DFTI_FORWARD_SCALE = 1.0\n");
qDebug(" DFTI_BACKWARD_SCALE = 1.0/n\n\n");
}
/*
** Allocate array for input data
*/
x_in = (mkl_double_complex*)malloc(2*n*sizeof(double));
x_exp = (mkl_double_complex*)malloc(2*n*sizeof(double));
/*
** Initialize x_in and copy to expected x_exp
*/
init_input_and_expected_vectors_z(x_in, x_exp, n);
if (ADVANCED_DATA_PRINT) {
qDebug(" INPUT vector X_IN\n");
print_vector_z( x_in, n);
}
/*
** Create DFTI descriptor for 1D double precision transform
*/
Status = DftiCreateDescriptor(&hand, DFTI_DOUBLE, DFTI_COMPLEX, 1, n);
if (! DftiErrorClass(Status, DFTI_NO_ERROR)) {
dfti_example_status_print(Status);
qDebug(" TEST FAILED : DftiCreateDescriptor(&hand, DFTI_DOUBLE,...\n");
failure++;
goto FREE_ARRAYS;
}
/*
** Commit DFTI descriptor
*/
Status = DftiCommitDescriptor(hand);
if (! DftiErrorClass(Status, DFTI_NO_ERROR)) {
dfti_example_status_print(Status);
qDebug(" TEST FAILED : DftiCommitDescriptor(hand)\n");
failure++;
goto FREE_DESCRIPTOR;
}
/*
** Compute Forward transform
*/
qDebug("\n Compute DftiComputeForward\n\n");
Status = DftiComputeForward(hand, x_in);
if (! DftiErrorClass(Status, DFTI_NO_ERROR)) {
dfti_example_status_print(Status);
qDebug(" TEST FAILED : DftiComputeForward(hand, x_in)\n");
failure++;
goto FREE_DESCRIPTOR;
}
if (ADVANCED_DATA_PRINT) {
qDebug(" Forward result vector X_IN\n");
print_vector_z( x_in, n);
}
/*
** Set Scale number for Backward transform
*/
Scale = 1.0/(double)n;
qDebug("\n DFTI_BACKWARD_SCALE = 1/n\n");
Status = DftiSetValue(hand, DFTI_BACKWARD_SCALE, Scale);
if (! DftiErrorClass(Status, DFTI_NO_ERROR)) {
dfti_example_status_print(Status);
qDebug(" TEST FAILED : DftiSetValue(hand, DFTI_BACKWARD_SCALE, Scale)\n");
failure++;
goto FREE_DESCRIPTOR;
}
/*
** Commit DFTI descriptor
*/
Status = DftiCommitDescriptor(hand);
if (! DftiErrorClass(Status, DFTI_NO_ERROR)) {
dfti_example_status_print(Status);
qDebug(" TEST FAILED : DftiCommitDescriptor(hand)\n");
failure++;
goto FREE_DESCRIPTOR;
}
/*
** Compute Backward transform
*/
qDebug("\n Compute DftiComputeBackward\n\n");
Status = DftiComputeBackward(hand, x_in);
if (! DftiErrorClass(Status, DFTI_NO_ERROR)) {
dfti_example_status_print(Status);
qDebug(" TEST FAILED : DftiComputeBackward(hand, x_in)\n");
failure++;
goto FREE_DESCRIPTOR;
}
if (ADVANCED_DATA_PRINT) {
qDebug(" Backward result vector X_IN\n");
print_vector_z( x_in, n);
}
/*
** Check result
*/
maxerr = check_result_z(x_in, x_exp, n);
if (ACCURACY_PRINT)
qDebug("\n Accuracy = %g\n\n", maxerr);
if (maxerr < eps) {
qDebug(" TEST PASSED\n");
} else {
qDebug(" TEST FAILED\n");
failure++;
}
/*
** Free DFTI descriptor
*/
FREE_DESCRIPTOR:
Status = DftiFreeDescriptor(&hand);
if (! DftiErrorClass(Status, DFTI_NO_ERROR)) {
dfti_example_status_print(Status);
qDebug(" TEST FAILED : DftiFreeDescriptor(&hand)\n");
failure++;
}
/*
** Free arrays for input and expected data
*/
FREE_ARRAYS:
free(x_in);
free(x_exp);
if (failure)
return 1;
qDebug("\n END OF TEST\n");
return a.exec();
}
Als Fehlermeldung erhalte ich u.a. (Fehler ist immer gleich, nur mit den anderen Funktionen):
Code: Alles auswählen
undefined reference to `read_data_file_1d(int, char**, long*)'
Ist vielleicht alles ein ziemliches Anfängerproblem, aber ich bin am Ende mit meinem Latein, will aber irgendwie endlich mal den Einstieg finden
gruß
Andreas