# \#include "TH/TH.h" error: undefined 'dpstrf\_'

**URL:** <https://discuss.pytorch.org/t/include-th-th-h-error-undefined-dpstrf-/8721>\
**Category:** Uncategorized\
**Created:** [October 16, 2017, 7:44am UTC](https://discuss.pytorch.org/t/include-th-th-h-error-undefined-dpstrf-/8721 "2017-10-16T07:44:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/paul/32/280_2.png) [@Paul](https://discuss.pytorch.org/u/Paul)\
**Post date:** [October 16, 2017, 7:44am UTC](https://discuss.pytorch.org/t/include-th-th-h-error-undefined-dpstrf-/8721/1 "2017-10-16T07:44:18Z")

</div>

I am sorry to ask this question again which is similar as the question as I asked before [5666](https://discuss.pytorch.org/t/include-th-th-h/5666). But I still do not know how to deal with it, I hope anyone who can help me, thank you advance !!!

My Question: How can I do the similar thing as example in [apaszke’s blog](https://apaszke.github.io/torch-internals.html) in pytorch:

```auto
#include "TH/TH.h"
int main()
{
    THFile *x_file = THDiskFile_new("x", "r", 0);
    THFile *y_file = THDiskFile_new("y", "r", 0);
    THFloatTensor *x = THFloatTensor_newWithSize1d(10);
    THFloatTensor *y = THFloatTensor_newWithSize1d(10);
    THFile_readFloat(x_file, x->storage);
    THFile_readFloat(y_file, y->storage);
    double result = THFloatTensor_dot(x, y) + THFloatTensor_sumall(x);
    printf("%f\n", result);
    THFloatTensor_free(x);
    THFloatTensor_free(y);
    THFile_free(x_file);
    THFile_free(y_file);
    return 0;
}

```

My cmake is as follows (this is a subdirectory):

```auto
file(GLOB hfile *.hpp *.h )   
file(GLOB cufile *.cu)        
set(exec main.cpp)

set(TORCH_LIB "My_Root_To_Anaconda/python3.5/site-packages/torch/lib")
message(${TORCH_LIB})
include_directories(${TORCH_LIB}/include)

add_executable(abs ${exec} ${hfile} ${cufile})

file(GLOB sofile ${TORCH_LIB}/*.so.*)
target_link_libraries(abs ${sofile})

```

However, when I `#include "TH/TH.h"`，there is the error as follows(I change the chinese to english):

```auto
torch/lib/libTH.so.1：undefined ‘dpstrf_’   
torch/lib/libTH.so.1：undefined ‘GOMP_parallel_start@VERSION’
.... and many other undefined

```

Additional: When I make [ATen](https://github.com/zdevito/ATen), and include .so file from that, it will not such error.
