V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  hhhhhh123  ›  全部回复第 10 页 / 共 13 页
回复总数  257
1 ... 2  3  4  5  6  7  8  9  10  11 ... 13  
2022-08-05 11:15:24 +08:00
回复了 hhhhhh123 创建的主题 程序员 如何定义,初 中 高 级开发?
@echo314 soga
2022-08-05 11:13:57 +08:00
回复了 hhhhhh123 创建的主题 程序员 如何定义,初 中 高 级开发?
@mazhiyuan 我也觉得是 看公司的划分制度
2022-08-05 11:08:19 +08:00
回复了 hhhhhh123 创建的主题 程序员 如何定义,初 中 高 级开发?
@fengjianxinghun 这 可能是对 HR 招聘看的, 那我们自身应该如何去评价?
@vincent441 他好像是使用 sync 出了问题,然后推荐 gevent,eventlet 异步模式,我 sync 模式是完全 ok 的, 但是 gevent,eventlet 模式不行.
2022-07-29 13:49:01 +08:00
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
解决了 extern "C" 我删掉了 忘记加上去了, 所以没有导出来, 加上后 重新编译 函数也能导出来了。
2022-07-29 13:47:35 +08:00
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
@yolee599 0000000000006710 T OMP_EVAL
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
U _Unwind_Resume@GCC_3.0
0000000000007c40 T _Z9benchmarkv
000000000000b460 T _ZN3omp13CombinedRange10joinRangesERKSt6vectorIS1_ISt5arrayIhLm2EESaIS3_EESaIS5_EEm
000000000000ad90 T _ZN3omp13CombinedRange7shuffleEv
000000000000ae90 T _ZN3omp13CombinedRangeC1EjRKSt6vectorISt5arrayIhLm2EESaIS3_EE
000000000000ad00 T _ZN3omp13CombinedRangeC1Ev
000000000000ae90 T _ZN3omp13CombinedRangeC2EjRKSt6vectorISt5arrayIhLm2EESaIS3_EE
000000000000ad00 T _ZN3omp13CombinedRangeC2Ev
0000000000014930 T _ZN3omp13HandEvaluator10staticInitEv
00000000000164c0 R _ZN3omp13HandEvaluator11FLUSH_RANKSE
0000000000026460 B _ZN3omp13HandEvaluator11ORIG_LOOKUPE
0000000000022460 B _ZN3omp13HandEvaluator12FLUSH_LOOKUPE
00000000000147f0 T _ZN3omp13HandEvaluator14populateLookupEmjjjjjjb



还有很多这样的 , 次数超过限制所有发不出来
2022-07-29 12:02:40 +08:00
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
@nifury @qbqbqbqb
@qbqbqbqb 我加了-fPIC 参数, 虽然能编译, 但是函数好像没有导出, 这个时候 应该怎么导出
2022-07-29 11:36:23 +08:00
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
@qbqbqbqb 我删除 extern "C" __declspec(dllexport) 这个了,但是出现了上面的错误, 你知道吗
2022-07-29 11:35:59 +08:00
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
@nifury 你知道这个错误吗? 我吧 extern "C" __declspec(dllexport) 删掉了
2022-07-29 11:35:31 +08:00
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
```
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/CardRange.o omp/CardRange.cpp
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/CombinedRange.o omp/CombinedRange.cpp
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/EquityCalculator.o omp/EquityCalculator.cpp
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/HandEvaluator.o omp/HandEvaluator.cpp
ar rcs lib/ompeval.a omp/CardRange.o omp/CombinedRange.o omp/EquityCalculator.o omp/HandEvaluator.o
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -shared -o hongyu.so main.cpp benchmark.cpp lib/ompeval.a
/usr/bin/ld: lib/ompeval.a(HandEvaluator.o): warning: relocation against `_ZN3omp13HandEvaluator8cardInitE' in read-only section `.text.startup'
/usr/bin/ld: /tmp/ccUEKBa8.o: relocation R_X86_64_PC32 against symbol `_ZSt4cout@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:25: hongyu] Error 1
```
2022-07-29 10:59:55 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 请教一下,win 本地 make 能 ok , 但是在服务器就找不到一个文件, 这是没有指定路径还是啥?
main.cpp:1:10: fatal error: omp/EquityCalculator.h: No such file or directory
1 | #include <omp/EquityCalculator.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
2022-07-29 09:18:21 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive gcc 都是最新的。 这不是源码吗? 应该是官方的吧
2022-07-28 15:53:21 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive

In file included from omp/EquityCalculator.cpp:1:
omp/EquityCalculator.h:76:21: error: ‘std::function’ has not been declared
76 | std::function<void(const Results&)> callback = nullptr,
| ^~~~~~~~
omp/EquityCalculator.h:76:29: error: expected ‘,’ or ‘...’ before ‘<’ token
76 | std::function<void(const Results&)> callback = nullptr,
| ^
omp/EquityCalculator.h:202:10: error: ‘function’ in namespace ‘std’ does not name a template type
202 | std::function<void(const Results& results)> mCallback;
| ^~~~~~~~
omp/EquityCalculator.h:15:1: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
14 | #include <unordered_map>
+++ |+#include <functional>
15 | #include <array>
omp/EquityCalculator.h:76:16: error: default argument missing for parameter 6 of ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, int)’
76 | std::function<void(const Results&)> callback = nullptr,
| ^~~~~~~~~~~~~
omp/EquityCalculator.h:74:67: note: ...following parameter 2 which has a default argument
74 | bool start(const std::vector<CardRange>& handRanges, uint64_t boardCards = 0, uint64_t deadCards = 0,
| ~~~~~~~~~^~~~~~~~~~~~~~
omp/EquityCalculator.cpp:13:6: error: no declaration matches ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, std::function<void(const omp::EquityCalculator::Results&)>, double, unsigned int)’
13 | bool EquityCalculator::start(const std::vector<CardRange>& handRanges, uint64_t boardCards, uint64_t deadCards,
| ^~~~~~~~~~~~~~~~
In file included from omp/EquityCalculator.cpp:1:
omp/EquityCalculator.h:74:10: note: candidate is: ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, int)’
74 | bool start(const std::vector<CardRange>& handRanges, uint64_t boardCards = 0, uint64_t deadCards = 0,
| ^~~~~
omp/EquityCalculator.h:22:7: note: ‘class omp::EquityCalculator’ defined here
22 | class EquityCalculator
| ^~~~~~~~~~~~~~~~
omp/EquityCalculator.cpp: In member function ‘void omp::EquityCalculator::updateResults(const omp::EquityCalculator::BatchResults&, bool)’:
omp/EquityCalculator.cpp:740:13: error: ‘mCallback’ was not declared in this scope
740 | if (mCallback)
| ^~~~~~~~~
make: *** [<builtin>: omp/EquityCalculator.o] Error 1
2022-07-28 15:51:57 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 在上面写了
#ifndef _GLIBCXX_BITS_UNIFORM_INT_DIST_H
#define _GLIBCXX_BITS_UNIFORM_INT_DIST_H

#include <type_traits>
#include <ext/numeric_traits.h>
#if __cplusplus > 201703L
# include <concepts>
#endif
#include <bits/concept_check.h> // __glibcxx_function_requires
#include <functional>


但是错误好像还是这个
2022-07-28 15:48:21 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 我不是 c++开发,是 python 开发
2022-07-28 13:54:12 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 这是修改后的
__uctype __urngmin = _UniformRandomBitGenerator::min();
__uctype __urngmax = _UniformRandomBitGenerator::max();
assert( __urngmin < __urngmax);

报错信息变多了....

g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/EquityCalculator.o omp/EquityCalculator.cpp
In file included from omp/EquityCalculator.cpp:1:
omp/EquityCalculator.h:76:21: error: ‘std::function’ has not been declared
76 | std::function<void(const Results&)> callback = nullptr,
| ^~~~~~~~
omp/EquityCalculator.h:76:29: error: expected ‘,’ or ‘...’ before ‘<’ token
76 | std::function<void(const Results&)> callback = nullptr,
| ^
omp/EquityCalculator.h:202:10: error: ‘function’ in namespace ‘std’ does not name a template type
202 | std::function<void(const Results& results)> mCallback;
| ^~~~~~~~
omp/EquityCalculator.h:15:1: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
14 | #include <unordered_map>
+++ |+#include <functional>
15 | #include <array>
omp/EquityCalculator.h:76:16: error: default argument missing for parameter 6 of ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, int)’
76 | std::function<void(const Results&)> callback = nullptr,
| ^~~~~~~~~~~~~
omp/EquityCalculator.h:74:67: note: ...following parameter 2 which has a default argument
74 | bool start(const std::vector<CardRange>& handRanges, uint64_t boardCards = 0, uint64_t deadCards = 0,
| ~~~~~~~~~^~~~~~~~~~~~~~
omp/EquityCalculator.cpp:14:74: error: ‘std::function’ has not been declared
14 | bool enumerateAll, double stdevTarget, std::function<void(const Results&)> callback,
| ^~~~~~~~
omp/EquityCalculator.cpp:14:82: error: expected ‘,’ or ‘...’ before ‘<’ token
14 | bool enumerateAll, double stdevTarget, std::function<void(const Results&)> callback,
| ^
omp/EquityCalculator.cpp: In member function ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, int)’:
omp/EquityCalculator.cpp:47:5: error: ‘mCallback’ was not declared in this scope
47 | mCallback = callback;
| ^~~~~~~~~
omp/EquityCalculator.cpp:47:17: error: ‘callback’ was not declared in this scope; did you mean ‘calloc’?
47 | mCallback = callback;
| ^~~~~~~~
| calloc
omp/EquityCalculator.cpp:48:23: error: ‘updateInterval’ was not declared in this scope; did you mean ‘mUpdateInterval’?
48 | mUpdateInterval = updateInterval;
| ^~~~~~~~~~~~~~
| mUpdateInterval
omp/EquityCalculator.cpp:51:9: error: ‘threadCount’ was not declared in this scope
51 | if (threadCount == 0)
| ^~~~~~~~~~~
omp/EquityCalculator.cpp:53:26: error: ‘threadCount’ was not declared in this scope
53 | mUnfinishedThreads = threadCount;
| ^~~~~~~~~~~
omp/EquityCalculator.cpp: In member function ‘void omp::EquityCalculator::updateResults(const omp::EquityCalculator::BatchResults&, bool)’:
omp/EquityCalculator.cpp:740:13: error: ‘mCallback’ was not declared in this scope
740 | if (mCallback)
| ^~~~~~~~~
make: *** [<builtin>: omp/EquityCalculator.o] Error 1
2022-07-28 13:51:43 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 好像还是不行, 弄了就出新的一堆错误
2022-07-28 09:46:35 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive static_assert( __urngmin < __urngmax, "Uniform random bit generator must define min() < max()");

我删除 static_ 后 就是上面的报错
2022-07-28 09:45:44 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 方法 1 成功解决一部分,但是方法 2 好像不行还是报错了 出现了两个新的错误
In file included from /usr/include/c++/11/bits/stl_algo.h:66,
from /usr/include/c++/11/algorithm:62,
from omp/CombinedRange.cpp:4:
/usr/include/c++/11/bits/uniform_int_dist.h:286:96: error: macro "assert" passed 2 arguments, but takes just 1
286 | assert( __urngmin < __urngmax, "Uniform random bit generator must define min() < max()");


niform_int_distribution<_IntType>::param_type&)’:
/usr/include/c++/11/bits/uniform_int_dist.h:286:9: error: ‘assert’ was not declared in this scope
286 | assert( __urngmin < __urngmax, "Uniform random bit generator must define min() < max()");
2022-07-28 09:36:37 +08:00
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 我是要 修改 /usr/include/c++/11/bits/uniform_int_dist 这些底层文件是吗? 修改后 会对其他代码编译什么的受影响吗
1 ... 2  3  4  5  6  7  8  9  10  11 ... 13  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2578 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms · UTC 06:41 · PVG 14:41 · LAX 22:41 · JFK 01:41
Developed with CodeLauncher
♥ Do have faith in what you're doing.